2014-11-20 137 views
0

我有一个IP地址XXX.XX.XX.XX在服务器上的Git仓库和我的用户名是UUU访问远程的Git仓库

在我的本地的笔记本电脑,我设置为我的.git如下/配置文件:

[remote "origin"] 
     url = [email protected]:/home/UUU/repositories/repo.git 
     fetch = +refs/heads/*:refs/remotes/origin/* 
     receivepack = /usr/bin/git-receive-pack 
     uploadpack = /usr/bin/git-upload-pack 

当我使用git推或拉的git我的笔记本电脑,我得到以下错误

bash: /usr/bin/git-upload-pack: No such file or directory 
fatal: Could not read from remote repository. 

Please make sure you have the correct access rights 
and the repository exists. 

我在做什么错?

+0

你为什么要指定receivepack/uploadpack? – 2014-11-20 19:15:18

回答

0

删除你已经添加到配置文件,而是一切:

git remote add origin [email protected]:repositories/repo.git 

正如你所看到的,对于用户UUU你只需要指定其家中的路径。

.git/config后应该有一个这样的条目:

[remote "origin"]         
     url = [email protected]:repositories/repo.git 
     fetch = +refs/heads/*:refs/remotes/github/* 
+0

这不起作用。我仍然收到同样的错误。 – jhaprade 2014-11-20 20:07:29

+0

git是否安装在远程机器上? – SzG 2014-11-20 20:08:21

+0

是的。我检查了它。并且所有的可执行文件,git,git-upload-pack和git-receive-pack都位于远程的PATH中的/ usr/bin文件夹中。 – jhaprade 2014-11-20 20:12:18