You can fix this issue by either stashing your changes for later or adding them to a commit.
The “commit your changes or stash them before you can merge” error is raised when you try to pull code from a remote repository that conflicts with a local change you have made to a repository. To solve this error, either commit your change to the repository, discard your change, or stash your change for later.
This is the same answer as another one of my questions re git troubles.
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.
Update: This blog post explains what's going on, sort of.
With regards to Joshua Hogendorn's answer: it seems to me that leaving Xcode open while working on the repository with git leads to these problems. It even led to a situation where git committed something that I thought to have stashed (and still had afterwards) but Xcode just wrote to the filesystem right during the rebase.
So: Close your Xcode project before you work on the repo with git if you want to be safe, and then you probably don't need the core.trustctime false setting.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With