试图与错误git拉:无法打开.git / FETCH_HEAD:权限被拒绝 [英] Trying to git pull with error: cannot open .git/FETCH_HEAD: Permission denied

查看:4200
本文介绍了试图与错误git拉:无法打开.git / FETCH_HEAD:权限被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  asgard @ asgard -A7N8X2-0:〜〜 / CollegePortal $ git pull 
error:can not open .git / FETCH_HEAD:Permission denied

然后我尝试这一个

  asgard @ asgard -A7N8X2-0:〜/ CollegePortal $ sudo git pull 
Permission denied公钥)。
致命:远程终端意外挂起

帮助我,我不明白这一点问题。

解决方案

好像第一个不工作是因为您的用户没有更改该目录的权限,第二,因为你的root用户没有正确的SSH密钥来访问该git仓库。



根据你想要做的事情,它可能是最好将资源库克隆到不同的目录,或者 chown 当前目录以便为用户完全访问。


Help me please, I am trying to run this in my terminal:

asgard@asgard-A7N8X2-0:~/CollegePortal$ git pull
error: cannot open .git/FETCH_HEAD: Permission denied

Then I try this one

asgard@asgard-A7N8X2-0:~/CollegePortal$ sudo git pull
Permission denied (publickey).
fatal: The remote end hung up unexpectedly

Help me, I don't understand this problem.

解决方案

It seems like the first one isn't working because your user doesn't have the permissions for changing that directory, and the second because your root user doesn't have the right SSH keys for accessing that git repository.

Depending on what you're trying to do, it might be better to clone the repository to a different directory, or maybe chown the current directory to have full access for your user

这篇关于试图与错误git拉:无法打开.git / FETCH_HEAD:权限被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆