为什么我的 git fetch 失败了:
fatal: The remote end hung up unexpectedly
我是一个私有(private)项目的合作者,并且已经成功地 fork 了该项目。我已经使用 github 示例设置了一个 Remote :
git remote add upstream git://github.com/{upstream owner}/{upstream project}.git
我可以看到远程是使用“git -v show -n upstream”添加的
Fetch URL: git://github.com/{upstream owner}/{upstream project}.git
Push URL: git://github.com/{upstream owner}/{upstream project}.git
我知道我的 ssh key 有效:
ssh -T git@github.com
Hi miketempleman! You've successfully authenticated, but GitHub does not provide shell access.
然而,当我尝试从上游存储库更新我的本地存储库时:
mike@ununtu-11:~/{directory}$ git fetch upstream
fatal: The remote end hung up unexpectedly
为这样一个愚蠢的问题道歉。
最佳答案
我认为 git://
只读 URI 不适用于私有(private)仓库,因此它们不是世界可读的(即,只有获得授权才能访问仓库)。
尝试使用不同的远程 URI:
git remote set-url upstream git@github.com:{upstream owner}/{upstream project}.git
或者,或者使用 HTTPS:
git remote set-url upstream https://{your username}@github.com/{upstream owner}/{upstream project}.git
关于git - 从上游 github 存储库获取失败挂断,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10146700/