为什么我不能添加上游git仓库?

问题描述 投票:-1回答:3

我拿了一把大师的叉子,大师在收到了一些更新的同时我现在想要进入我的叉子。所以我做的是:将fork克隆到本地磁盘,进入dir并使用git remote add upstram http://xx.xxx.xxx.xxx:pppp/path/to.git将master添加为上游repo。然后一个git fetch upstream给了我:

fatal: 'upstream' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

而且我的磁盘上也有克隆主控仓库,所以我确实有读访问权限。这有什么问题?

谢谢!

git master upstream-branch
3个回答
4
投票

很抱歉以这种方式回复,但我无法发表评论。

你注意到你的命令是:git remote add upstream qazxsw poi

“上游”不是“上游”?

我相信这可能是问题......

如果你还不熟悉这个命令 - 运行“git remote -v”来查看遥控器。


0
投票

因为我认为你想用远程仓库连接你的本地git仓库,这是我的建议,考虑使用:http://xxx.xxx.xxx.xxx:pppp/path/to.git这是用于更改你的git远程仓库链接refs。

对于新的本地git仓库,您应该使用:git remote set-url origin [your remote git repo url]

我希望这会对你有所帮助。


0
投票

在您的命令中添加您命名为upstream的remote,而不是上游。检查遥控器的名称:git remote show

© www.soinside.com 2019 - 2024. All rights reserved.