Trying to discard changes on my system, and make it exactly the same as origin/master:
git fetch --all
git reset --hard origin/master
I’ve done this before on same repo without problems, but this time it fails with the following:
fatal: Could not reset index file to revision 'origin/master'
Have tried the following:
- remove index and reset as suggested here:
rm .git/index
git reset
- also suggested here that some process could have a lock on .git\index. That killing process and then executing
git reset
could fix it, but not sure how to check if something has a lock on file remotely. Also seems that removing index file and reset would have had same effect.