我在不同的網絡上有兩個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