3

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 (git status 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:

'for i in $(git br | grep -e "\srf-"); do git co $i; git rebase master || break; done; git co master'

A lot of times it will break in the middle saying:

Cannot rebase: You have unstaged changes.
Please commit or stash them.

When I run git status, 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.

I found a couple of other 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.

git version: 1.9.1

OS: Linux Mint, kernel: 3.16.0-38-generic

Community
  • 1
  • 1
lobati
  • 9,284
  • 5
  • 40
  • 61

1 Answers1

-1

This seems to be caused by the fact that the git repo is stored in a Dropbox folder. When I pause syncing on Dropbox, everything seems to rebase cleanly without hiccups.

lobati
  • 9,284
  • 5
  • 40
  • 61