首页 > 解决方案 > 从上游获取 fork repo 失败

问题描述

我对 GitHub 存储库做了一个分支并做了一些更改,现在我需要针对原始存储库的主服务器重新设置它

https://github.com/kubernetes/ingress-nginx

我试过了

git remote add origin git@github.com:kubernetes/ingress-nginx.git


 git fetch upstream 

我得到了一个错误

远程:未找到存储库。致命:找不到存储库https://github.com/kubernetes/ingr/

我不明白为什么repo cut的后缀以及如何克服它,我只需要重新针对master

我做了这个步骤

如何更新 GitHub 分叉存储库?

我也试过

 git remote set-url origin git@github.com:kubernetes/ingress-nginx.git

git remote add upstream https://github.com/kubernetes/ingress-nginx.git

git fetch upstream

这没有帮助

标签: gitgithub

解决方案


我认为最后两个命令应该是可行的,如果不试试下面检查出了什么问题

mkdir /tmp/fetchtest && cd /tmp/fetchtest
git init
git remote add upstream https://github.com/kubernetes/ingress-nginx.git
git fetch

推荐阅读