当我尝试 pull 时:
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.
最佳答案
通读“man git-push”,他们提到“git pull”应该足以解决这个问题,但是既然你得到“错误:无法打开 .git/FETCH_HEAD:权限被拒绝”,你是否可能创建了使用 sudo 克隆分支?如果是这样,您的用户可能无法读取您的文件。仔细检查文件 .git/FETCH_HEAD 是否可由您的用户帐户读取。
关于git - 无法推送或 pull 到 Github,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10445478/