开发者社区> 问答> 正文

git pull之后提示fatal: cannot exec 'git-pull': Permission denied

我的情况是这样的: 公司的git服务器在另一台机器上,我使用的是一台开发机 git的大部分命令可用,少数几个不可用,例如 git pull,git rebase,git stash

检查了一下权限 strace -f -eexecve git pull 2>&1 | grep EACC 提示 [pid 26018] execve("/root/libexec/git-core/git-pull", ["git-pull"], [/ 22 vars /]) = -1 EACCES (Permission denied) 但是git-pull这个目录是在root下的,修改了这个目录的权限后,仍然不可访问 请问这种情况怎么解决好呢? 还是说压根儿就是我git的权限有问题? 先谢谢了

展开
收起
a123456678 2016-06-16 17:01:24 4636 0
1 条回答
写回答
取消 提交回答
  • 可以看一下这个mail-list,和楼主描述的问题差不多:http://comments.gmane.org/gmane.comp.version-control.git/147854

    试试git fetch/cherry-pick如果没有提示权限问题,很肯能就是链接提到的问题了:

    Then the next thing to try is probably (assuming you are running Linux): Well, kind of: it's CentOS, which I'm finding quite recalcitrant (e.g. I had to install strace). strace -f -e execve git pull

    Though I suspect we may just see:

    execve("/opt/libexec/git-core/git-core/git-pull", ...) = -1 EACCES (Permission denied)

    which doesn't help much. I just want to be sure that is the source of the problem. No, the output is interesting. The permissions denied is from the erroneous /root install (see separate email):
    [pid 3485] execve("/root/libexec/git-core/git-pull",
    ["git-pull"], [/ 18 vars /]) = -1 EACCES (Permission denied)

    It looks in /opt/bin, but not /opt/libexec.
    That looks like you are either running wrong git binary (one in /root/bin?) or the git installation is busted.

    No, the git libexec directory SHOULD NOT be in PATH (git will add it there when needed).

    2019-07-17 19:41:22
    赞同 展开评论 打赏
问答分类:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
AGit-Flow:新一代高效Git协同模型 立即下载
AGit-flow:新一代高效Git协同模型 立即下载
新一代高效Git协同模型 立即下载

相关实验场景

更多