我在不同的网络上有两个git仓库。我一直在他们两个人之间的沟通没有问题,但由于某种原因,今天,当我在做一个“混帐推”,我收到以下错误:git push error git-receive-pack
----------------------------------------------
bash: git-receive-pack: command not found
fatal: The remote end hung up unexpectedly
----------------------------------------------
我一派,并提出确保“的/ usr/local/bin“在我的”$ PATH“中。这里是我的混帐的bin目录的输出:
[[email protected] ]$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 [email protected] -> 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 [email protected] -> 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用户@远程ENV’从我机器到远程机器:
[[email protected] ~]$ssh [email protected] 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
这是你的$ PATH中的'/ usr/local/git/bin /'吗? – number5
是的。 [pradeep @ laptop] $ echo $ PATH /Library/Frameworks/Python.framework/Versions/2.7/bin:/Library/Frameworks/Python.framework/Versions/Current/bin:/Users/pradeep/softwares/hdf-java /bin/:/Users/pradeep/softwares/ParaView/paraview-bin/bin/:/Users/pradeep/softwares/ParaView/paraview-bin/bin/paraview.app/Contents/MacOS/:/Users/pradeep/code/python_utilities /:在/ usr/bin中:/ bin中:/ usr/sbin目录:/ sbin目录:在/ usr/local/bin目录中:/ opt/X11/bin中:在/ usr /本地/ git的/ bin中:在/ usr/texbin:/用户/ pradeep/bin – jhaprade
你应该检查远程的'PATH',而不是你试图“推送”的机器。我这样说是因为'pradeep @ laptop'看起来不像远程服务器。如果确实如此,请忽略此评论。 – Tuxdude