3
git clone blah
git checkout -b development
git checkout -b bug581
hack hack
git checkout -b bug588
hack hack

oh wait, bug 588 should sprout from development, not 581.

git rebase --onto development bug581 bug588

gives me:

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

err, but i dont? git status shows working directory is clean. so lets stash just for giggles.

git stash
git rebase --onto development bug581 bug588

ok now it works, but its pulling the history of bug 581 and 588, i just want the history of 588, not what was in 581.

jhogendorn
  • 5,931
  • 3
  • 26
  • 35

3 Answers3

6

I'm on a mac, and this obscure config change seemed to fix all my woes regarding unstaged changes when there were none.

git config --global core.trustctime false

I think it's to do with differences between windows file times, linux file times and mac file times. who knows, feel free to comment if you do.

jhogendorn
  • 5,931
  • 3
  • 26
  • 35
  • Same problem on OSX Snow Leopard following a bunch of renames, working on a NFS mount. Config change worked --Thanks! – Grae Kindel Oct 28 '11 at 20:41
2

Do you have auto rebase turned on?

look in your ~/.gitconfig or .git/config for

[branch "master"]
  rebase = true

or

[branch]
  autosetuprebase = always
Gordolio
  • 1,925
  • 15
  • 22
0

The second time you do "hack hack", is where your unstaged changes occurred.

Arafangion
  • 11,517
  • 1
  • 40
  • 72
  • well i thought it was fairly obvious from my language that any changes were committed so the working directory would be clean. – jhogendorn Feb 14 '11 at 04:56
  • @devians: You never once mention a commit. We are programmers, be precise. – Arafangion Feb 14 '11 at 05:15
  • "git status shows working directory is clean" would imply so. In fact, considering the problem is elsewhere i think its fair to assume that i'm always committed with a clean working directory. – jhogendorn Feb 14 '11 at 05:52
  • @devians: Hmm, could you confirm that the file line endings are as expected? I've had weird things like that on windows with specific crlf settings? What platform are you on, anyway? – Arafangion Feb 14 '11 at 07:36