Git error solution for “unable to resolve reference” “unable to update local ref”

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/Lockey23/article/details/81736688

大清早就遇到一个意外的问题,幸好在stackoverflow上找到了对应topic

error: unable to resolve reference refs/remotes/origin/master: No such file or directory

! [new branch] master -> origin/master (unable to update local ref)

make sure you choose the file that is giving you problems instead of master, as above mentions file master, so my solution showing as below:

Execute the following commands:

rm .git/refs/remotes/origin/master

git fetch

git branch --set-upstream-to=origin/master

Just in case, if you need to know what is .git/refs/remotes/origin/master, you would read the Remotes section in Git References(https://git-scm.com/book/en/v2/Git-Internals-Git-References).

猜你喜欢

转载自blog.csdn.net/Lockey23/article/details/81736688