vvondra vvondra - 1 month ago 18
Git Question

Cannot pull, git cannot resolve reference ORIG_HEAD

while pulling into my git repository from our central server, this error occured:

$ git pull origin master

From http://aaa/repo
* branch master -> FETCH_HEAD
error: unable to resolve reference ORIG_HEAD: No such file or directory
fatal: Cannot lock the ref 'ORIG_HEAD'.


I've tried git gc (with --prune=now) and looking for a similar error, unfortunately with no luck.

Answer

I had this problem, and I solved it by removing the file .git/ORIG_HEAD then doing the pull again. The .git/ORIG_HEAD file was 0 bytes instead of the git reference it was supposed to contain, so I just got rid of it.

Comments