#git#git-upload-pack: command not found错误的解决方法

 

在WIN7体验完git后,决定建一个git服务器做远程备份,找了台redhat linux。

1.安装

倒是没遇到什么困难,直接成功。

./configure --prefix=/home/mawx/_bin/git

make;make install

2.接着在win7下生成裸库,再传到服务器上。

git clone --bare git_data git_data.git

scp -r git_data.git/ [email protected]:/home/mawx/data/git 

3.在本地进行clone

git clone  [email protected]:/home/mawx/data/git/git_data

 

一直提示:

bash: git-upload-pack: command not found

fatal: The remote end hung up unexpectedly

一开始怀疑是#msysgit#的问题,后来查了网上说是因为服务器没有安装在默认的路径引起的。

先用ssh you@remotemachine echo \$PATH查看你的git服务器端安装目录在不在,不在就在

.bashrc加上这一句

PATH=$HOME/_bin/git/bin:$PATH

搞定!

注意,加在.bash_profile 没用。。。这个让我兜了不少圈。

 

 

参考文档:
http://git-upload-pack-command-not-found-how.225291.ccqq.net/

你可能感兴趣的:(git)