title: Getting git return values in shell script
body: <p>I'm writing a shell script that makes some git calls. In particular, I'm looking for a way to figure out if a git rebase call is successful or if there is a merge conflict. This is what I have so far.</p>
  
  <pre><code>returnStatus=$(git rebase master);
  if [[ returnStatus == 1 ]]; then
      break;
  else
      echo $branch; echo "rebased successfully";
  fi
  </code></pre>
  
  <p>However, I think the first line isn't storing the return value, but the actual output of the rebase call. I need to know whether it was successful or not. How can I do this?</p>
  
  <p>Thanks in advance! Any advice is much appreciated.</p>