Currently git is stuck in a loop. It can't merge because of local changes. I can't stash local changes because none are found.
$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean
$ git pull
remote: Counting objects: 5, done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 5 (delta 3), reused 0 (delta 0)
Unpacking objects: 100% (5/5), done.
From https://private/url/project/
e56777c..fac7619 master -> origin/master
Updating e56777c..fac7619
error: Your local changes to the following files would be overwritten by merge:
ProjectSettings/EditorBuildSettings.asset
Please, commit your changes or stash them before you can merge.
Aborting
$ git status
On branch master
Your branch is behind 'origin/master' by 1 commit, and can be fast-forwarded.
(use "git pull" to update your local branch)
nothing to commit, working directory clean
$ git pull
Updating e56777c..fac7619
error: Your local changes to the following files would be overwritten by merge:
ProjectSettings/EditorBuildSettings.asset
Please, commit your changes or stash them before you can merge.
Aborting
$ git stash
No local changes to save
$ git fetch
$ git status
On branch master
Your branch is behind 'origin/master' by 1 commit, and can be fast-forwarded.
(use "git pull" to update your local branch)
nothing to commit, working directory clean
$ git stash
No local changes to save
$ git merge
Updating e56777c..fac7619
error: Your local changes to the following files would be overwritten by merge:
ProjectSettings/EditorBuildSettings.asset
Please, commit your changes or stash them before you can merge.
Aborting
$ git stash
No local changes to save
Trying the accepted answer on this question, doesn't work. I get the following error:
$ git fetch --all
Fetching origin
$ git reset --hard origin/master
error: Entry 'ProjectSettings/EditorBuildSettings.asset' not uptodate. Cannot merge.
fatal: Could not reset index file to revision 'origin/master'.
Someone is able to reliably reproduce and fix the last error: 'Could not reset index...' but the workaround they suggest produces the follow error for me:
$ git add .
$ git reset --merge fac7619
error: Entry 'ProjectSettings/EditorBuildSettings.asset' not uptodate. Cannot merge.
fatal: Could not reset index file to revision 'fac7619'.
Is there anyway to force git to overwrite the ProjectSettings? or ask it why it thinks there are local changes when none are found?
Edit:
Ok, after doing reset --merge
, I did reset --hard
then git status
notified me I was behind 1 commit, This time when I did git pull
everything merged with no issues.
So, how can the above scenario be avoided?
Or is this something that is common to multi-OS environments?
My workflow is fairly consistant. I start with a pull, make edits, add, commit, push. But, for this project, sometimes I am on a windows machine, others I am using OSX. I just have not run into this issue in 2 years of using git.