2012-02-26 52 views
1

我知道已經有一個類似post,但似乎提出的解決方案並沒有爲我工作...SH:混帳上載包裝:命令未找到

我的同事已經下創建一個存儲庫/git/work他的帳戶。在我的遠程機器,我可以做到以下幾點:

... > git clone /users/.../HisAccount/git/work 
Initialized empty Git repository in /import/.../MyAccount/work/.git/ 

但我需要遠程控制我的機器/帳戶,所以我想我的本地機器上的以下內容並得到了一個錯誤:

[email protected]$ git clone [email protected]:/users/.../HisAccount/git/work 
Cloning into work... 
[email protected]'s password: 
sh: git-upload-pack: command not found 
fatal: The remote end hung up unexpectedly 

在我的本地和遠程機器上,我可以看到/usr/bin/git-upload-pack。本地機器上的path/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games;和我的遠程機器上的path/users/.../MyAccount/bin/ubuntu /users/.../MyAccount/bin /user/local/bin /usr/bin /bin /usr/hosts /usr/ucb /usr/openwin/bin .

在我的本地機器上,我也嘗試過這樣的:

... > git clone -u /usr/bin/git-upload-pack [email protected]:/users/.../HisAccount/git/work 
Cloning into work... 
[email protected]'s password: 
sh: /usr/bin/git-upload-pack: No such file or directory 
fatal: The remote end hung up unexpectedly 

順便說一句,我真的不知道哪裏是.bashrc(這個Bash),.zshenv (對於Zsh)或.cshrc(對於tcsh)...

任何人都可以幫忙嗎?

回答

0

檢查$ PATH , as set in your "的.bashrc (for Bash), .zshenv (for Zsh),(對於tcsh).cshrc`」
(取決於current shell您正在運行)

其中一個文件應該在你的$HOME(主目錄) 。

從評論中,OP確認

  • /usr/bin/git-upload-pack: No such file or directory意味着該路徑(這是正確的)實際上不包括git-upload-pack腳本。 This answer建議符號鏈接到它。
  • git-upload-pack腳本被稱爲遠程側,作爲OP確認:

It turns out that the remote machine has problem... I have tested with another machine, and it works.

+0

在遠程計算機上,但沒有這些3個文件的存在(殼是tcsh的);在本地機器上有'.bashrc',但是我沒有找到它的路徑... – SoftTimur 2012-02-26 19:22:45

+0

@SoftTimur這些文件不一定總是存在。它們僅由用戶在他/她的shell會話中修改某個環境變量時創建。 – VonC 2012-02-26 20:39:50

+0

那麼,我應該在遠程計算機上添加一個'.cshrc'並更改'$ PATH'?但是它當前的'$ PATH'確實結束了'usr/bin' ... – SoftTimur 2012-02-26 21:54:39