【问题标题】:Accessing a remote git repository访问远程 git 存储库
【发布时间】:2015-01-18 18:55:00
【问题描述】:

我在 IP 地址为 XXX.XX.XX.XX 的服务器上有一个 git 存储库,我的用户名是 UUU

在我的本地笔记本电脑中,我在 .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.

我做错了什么?

【问题讨论】:

  • 为什么要指定receivepack/uploadpack?

标签: git git-push git-pull


【解决方案1】:

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

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

如您所见,对于用户 UUU,您只需指定其 home 内的路径。

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

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

【讨论】:

  • 那行不通。我仍然遇到同样的错误。
  • 远程机器上是否安装了git?
  • 是的。我检查了它。并且所有的可执行文件,git、git-upload-pack 和 git-receive-pack 都在远程路径的 /usr/bin 文件夹中。
  • 你的.git/config现在怎么样了?
  • 和我原来的帖子一样。我回去了。
猜你喜欢
  • 2013-09-05
  • 1970-01-01
  • 2011-06-29
  • 2010-10-09
  • 2012-11-28
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-04-13
相关资源
最近更新 更多