I'm using git-svn, and I'm trying to run git svn rebase
.
I get the error:
Your local changes to the following files would be overwritten by checkout:
<filename>
Please, commit your changes or stash them before you can switch branches.
I have previously run git update-index --assume-unchanged <filename>
, and made changes to the file, but I've now run git update-index --no-assume-unchanged <filename>
to get rid of that.
git status
doesn't report any changes and git stash
says there's nothing to stash.
I have checked that the file is not in .gitignore
or .git/info/exclude
How can I debug this problem further?
I was having this problem and Tim's answer helped me figure out the solution.
In the past I had run:
git update-index --assume-unchanged index.php
After making a bunch of changes to another branch remotely, I was getting the overwrite warning while trying to switch over locally.
git checkout other-branch
error: Your local changes to the following files would be overwritten by checkout:
index.php
Please, commit your changes or stash them before you can switch branches.
Aborting
Stashing wasn't working.
git stash save --keep-index
No local changes to save
git update-index --no-assume-unchanged index.php
git add index.php
git commit
After that.
git checkout other-branch
Success!
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