访问远程git存储库

时间:2014-11-20 19:12:05

标签: git git-push git-pull

我在IP地址为XXX.XX.XX.XX的服

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

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

当我在笔记本电脑上使用git push或git pull时,我收到以下错误

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.

我做错了什么?

1 个答案:

答案 0 :(得分:0)

只需删除您添加到配置文件中的所有内容,而不是:

git remote add origin UUU@XXX.XX.XX.XX:repositories/repo.git

如您所见,对于用户UUU,您只需在其家中指定路径。

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

[remote "origin"]                                  
        url = UUU@XXX.XX.XX.XX:repositories/repo.git
        fetch = +refs/heads/*:refs/remotes/github/*
相关问题