【发布时间】:2023-03-14 17:08:01
【问题描述】:
我最近设置了一个新的 VPS,并通过 yum 和 wget 等安装了 Git。一切似乎都很好 - 我可以添加、提交、设置远程并推送到 github。
但是,当我尝试从 github 拉取时:
user@domain.com [~]# git pull github master
git: 'pull' is not a git command. See 'git --help'.
Did you mean this?
shell
不,我不是说 shell,我是说 pull!
现在我已经用谷歌搜索了这件事——包括阅读 Stackoverflow 上的几篇文章:
git: 'pull' is not a git command. See 'git --help'
虽然大多数帖子似乎是关于 Mac 问题(我在 CentOS 服务器上),但这似乎是 git exec 路径的问题,即
user@domain.com [~]# git --exec-path
/usr/local/libexec/git-core
我尝试向 .bashrc 添加各种内容,但没有成功。
关键是当我 cd 到 /usr/local/ 和 ls -l 时,我看不到 libexec 目录。
但如果我以 root 身份登录,我可以 cd 到 /usr/local/ 并查看 libexec/,其中是 git-core。我也可以以 root 身份 git pull。
所以 - 我怀疑问题更多是与权限和服务器设置有关,而不是 git 本身。
我试过了
sudo chmod a+rx /usr/local/libexec
但这也不是...
当我 ssh 到另一台服务器时,作为帐户用户,我可以 cd 到 /usr/local 并查看 libexec - 所以这个服务器设置有问题。
感谢您的任何想法。
【问题讨论】:
-
检查 /usr/local 是如何挂载的;可能它是仅对
root可见的动态覆盖。顺便说一句,我真的不认为这是git问题,而是您系统的配置问题 -
感谢 umlaeute,我现在已经解决了 - 服务器正在使用越狱...禁用越狱并使用“普通”shell 是一种享受。
-
@user1455542 您应该将其发布为答案并接受它