I did a git pull this afternoon. The merge failed with a thousand files conflicting. I couldn't find a command that worked after the merge conflicted to chose "theirs" strategy on all files and I didn't want to resolve each so I tried aborting the merge. git reset --merge
, git merge --abort
, and git checkout master
didn't work. There was no merge head and the other failed. I tried git reset --hard HEAD
and 8 hours later it's only at 50%. Why did this happen and how can I avoid this in the future? I have a RAID SSD and I could just clone the repo again in maybe 15 minutes.
Possible solutions if anyone knows one of these:
- A command that resets fast.
- A command after a merge fails that choses "theirs" for all files like
git checkout --theirs .
(this command didn't work)
I was fairly thorough and didn't see the solution to a large merge conflict in any of the popular git questions.
Here are the errors:
C:\Users\sticker592\source\repos\netDocs\docs-1>git reset --merge
error: Untracked working tree file '.gitattributes' would be overwritten by merge.
fatal: Could not reset index file to revision 'HEAD'.
C:\Users\sticker592\source\repos\netDocs\docs-1>git merge --abort
fatal: There is no merge to abort (MERGE_HEAD missing).
C:\Users\sticker592\source\repos\netDocs\docs-1>git merge --strategy-option theirs
Already up-to-date.
C:\Users\sticker592\source\repos\netDocs\docs-1>git merge master --strategy-option theirs
Already up-to-date.
C:\Users\sticker592\source\repos\netDocs\docs-1>git checkout --theirs
fatal: '--ours/--theirs' cannot be used with switching branches
C:\Users\sticker592\source\repos\netDocs\docs-1>git merge -X theirs master
Already up-to-date.
C:\Users\sticker592\source\repos\netDocs\docs-1>git status
On branch master
Your branch is up-to-date with 'origin/master'.
The merge was still in conflict according to VS team explorer and it required before I push or commit for me to resolve the conflicts.