Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在windows上使用github时出现权限被拒绝的错误_Windows_Git_Github - Fatal编程技术网

在windows上使用github时出现权限被拒绝的错误

在windows上使用github时出现权限被拒绝的错误,windows,git,github,Windows,Git,Github,就在两周前,我还在编写代码,进行提交并毫无顾虑地推送到github。我刚回来又开始工作,突然间我不能做出承诺,推,甚至拉 推送错误: Unable to append to .git/logs/refs/remotes/origin/master: Permission Denied Cannot update the ref 'refs/remotes/origin/master'. 拉取错误: 无法附加到.git/logs/refs/remotes/origin/master:权限被拒绝

就在两周前,我还在编写代码,进行提交并毫无顾虑地推送到github。我刚回来又开始工作,突然间我不能做出承诺,推,甚至拉

推送错误:

Unable to append to .git/logs/refs/remotes/origin/master: Permission Denied
Cannot update the ref 'refs/remotes/origin/master'.
拉取错误: 无法附加到.git/logs/refs/remotes/origin/master:权限被拒绝

由于“正在被另一个程序使用”或只读错误,我也无法编辑工作目录中的多个文件,我的最后一次提交是
未同步


我检查了文件权限和github SSH密钥,并尽力查找解决方案,但这似乎通常是Unix用户权限问题,而不是Windows问题。我真的不知道该继续找哪里。

您以前是管理员吗

.git文件夹是否位于受保护的位置

谁拥有.git文件夹


以管理员身份运行git shell是否解决了此问题?(请注意,这不是一个解决方案,只是一种调试机制,您不应该将git用作root)

。git文件夹不受保护,它归我的用户所有。我以前可能是管理员。当我以管理员的身份运行它并尝试提交时,我遇到了一个与以前不同的错误:>致命:无法创建“myapp/.git/refs/heads/master.lock”:文件存在。经过一些调整后,我已设法使用管理员git shell进行提交。我可能一直都是这样做的。你知道我如何将文件所有权改为我的用户吗?