2014-11-20 135 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