linux - git pull之后提示fatal: cannot exec 'git-pull': Permission denied
PHP中文网
PHP中文网 2017-04-17 11:18:14
[Linux讨论组]

我的情况是这样的: 公司的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的权限有问题? 先谢谢了

PHP中文网
PHP中文网

认证0级讲师

全部回复(2)
迷茫

可以看一下这个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).

黄舟

可能是你的perl安装错误或是版本太低,我是重新安装perl就对了

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号