当我尝试拉动时:
error: cannot open .git/FETCH_HEAD: Permission denied
当我尝试推送或push -u origin master
:
master -> master (non-fast-forward)
error: failed to push some refs to 'git@github.com:xxxxxxxx/xxxxxxxxxx.git'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes before pushing again. See the 'Note about
-forwards' section of 'git push --help' for details.
答案 0 :(得分:7)
阅读“man git-push”他们提到“git pull”应该足以解决这个问题,但是因为你得到“错误:无法打开.git / FETCH_HEAD:Permission denied”你是否创建了使用sudo克隆分支?如果是这样,您的用户可能无法读取您的文件。仔细检查您的用户帐户是否可以读取.git / FETCH_HEAD文件。
答案 1 :(得分:3)
您的本地副本可能与远程集线器不同步。
从/向github repo拉/推时,这是一个很好的指导原则: