我在不同的网络上有两个 git 存储库。我一直在他们两个之间毫无问题地交流,但由于某种原因,今天当我执行“git push”时,我收到以下错误:
----------------------------------------------
bash: git-receive-pack: command not found
fatal: The remote end hung up unexpectedly
----------------------------------------------
我用谷歌搜索并确保“/usr/local/bin”在我的“$PATH”中。这是我的 git 的 bin 目录的输出:
[pradeep@laptop ]$ls -l /usr/local/git/bin/
total 16760
-rwxr-xr-x 1 root wheel 4329416 Mar 26 20:06 git*
-rwxr-xr-x 1 root wheel 14852 Mar 26 20:06 git-credential-osxkeychain*
-rwxr-xr-x 2 root wheel 162402 Mar 26 20:06 git-cvsserver*
lrwxr-xr-x 1 root wheel 3 Apr 3 11:02 git-receive-pack@ -> git
-rwxr-xr-x 2 root wheel 1830248 Mar 26 20:06 git-shell*
lrwxr-xr-x 1 root wheel 3 Apr 3 11:02 git-upload-archive@ -> git
-rwxr-xr-x 2 root wheel 1893064 Mar 26 20:06 git-upload-pack*
-rwxr-xr-x 1 root wheel 333121 Mar 26 20:06 gitk*
有什么想法可能会出错吗?
谢谢
-------------- 编辑 -------------------- 我的远程系统的“.bashrc”中有以下行:
export PATH=$LOCAL/git-1.8/bin/:$PATH
这是远程机器上的输出:
$ls $LOCAL/git-1.8/bin
git git-cvsserver gitk git-receive-pack git-shell git-upload-archive git-upload-pack
这是我从我的机器到远程机器执行“ssh user@remote env”时的输出:
[pradeep@laptop ~]$ssh k00603@k.rics.riken.jp env
SHELL=/bin/bash
SSH_CLIENT=153.133.52.171 52379 22
USER=k00603
MAIL=/var/mail/k00603
PATH=/usr/local/bin:/bin:/usr/bin:/usr/local/openssh/bin
PWD=/volume2/home/hp120242/k00603
SHLVL=1
HOME=/home/hp120242/k00603
LOGNAME=k00603
SSH_CONNECTION=153.133.52.171 52379 10.7.160.4 22
LC_CTYPE=en_US.UTF-8
_=/bin/env
bash 中缺少 git 路径。
编辑:以下是我的远程系统主目录中的“.bash_profile”:
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin:$LOCAL/git-1.8/bin
export PATH