title: Intermittent git error: "Cannot rebase: You have unstaged changes."
body: <p>I see a lot of intermittent git errors when changing to or rebasing branches. Sometimes it will tell me I can't change branches because it would conflict with unstaged changes, even though my branch is clean (<code>git status</code> shows "nothing to commit, working directory clean"). If I try the same command again, it works the second time. Similarly, I have a command to rebase all of my branches:</p>
  
  <pre><code>'for i in $(git br | grep -e "\srf-"); do git co $i; git rebase master || break; done; git co master'
  </code></pre>
  
  <p>A lot of times it will break in the middle saying:</p>
  
  <pre><code>Cannot rebase: You have unstaged changes.
  Please commit or stash them.
  </code></pre>
  
  <p>When I run <code>git status</code>, again, "nothing to commit, yada yada". If I just run the command again, it works, or ends up breaking on a different branch instead. Running it a handful of times it will eventually get through all of them without any intervention from me. Why do I keep getting these kinds of error messages when I have no unstaged changes anywhere? It seems like maybe git hasn't finished whatever operation it was handling before, so if it's something like that I'm wondering if there's a way to explicitly wait for it to be done.</p>
  
  <p>I found a <a href="https://stackoverflow.com/questions/21358872/git-cannot-rebase-because-of-uncommitted-changes">couple</a> of <a href="https://stackoverflow.com/questions/9167542/weird-git-rebase-error">other</a> similar questions, but it looks like for other people it's consistent and for me it's not. The command ends up going through if I try it again.</p>
  
  <p>git version: 1.9.1</p>
  
  <p>OS: Linux Mint, kernel: 3.16.0-38-generic</p>