简体   繁体   English

git远程跟踪分支返回“请求的上游分支不存在”

[英]git remote tracking branch return "requested upstream branch does not exist"

I've git config like this:我有这样的 git 配置:

[remote "origin"]
   url = git@bitbucket.org:archie/learn-express.git
   fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
   remote = origin     <==== 
   merge = refs/heads/master
[remote "znotanto"]
   url = https://archie@bitbucket.org/znotanto/learn-express.git
   fetch = +refs/heads/*:refs/remotes/znotanto/*

I wanna change the part that I show with arrow to znotanto .我想将我用箭头显示的部分更改为znotanto I've tried git branch master --set-upstream-to znotanto/master from so but give me error我试过git branch master --set-upstream-to znotanto/master from so但给我错误

error: the requested upstream branch 'znotanto/master' does not exist错误:请求的上游分支“znotanto/master”不存在

Does the repository copy over at znotanto ( https://archie@bitbucket.org/znotanto/learn-express.git ) actually have a branch named master yet?znotanto ( https://archie@bitbucket.org/znotanto/learn-express.git ) 上复制的存储库实际上有一个名为master的分支吗?

If so, use:如果是这样,请使用:

git fetch znotano

to get your Git to learn about it.让你的 Git 了解它。 This will have your Git create your remote-tracking name znotanto/master , after which you will be able to set znotanto/master as the upstream of any of your branches.这将使您的 Git 创建您的远程跟踪名称znotanto/master ,之后您将能够将znotanto/master设置为任何分支的上游。

If not, you need to first create the name master in the Git repository at znotanto , so that your Git will see it so that your Git will create your remote-tracking name znotanto/master .如果没有,您需要首先在znotanto的 Git 存储库中创建名称master ,以便您的 Git 看到它,以便您的 Git 将创建您的远程跟踪名称znotanto/master So in this case, first create that branch there—exactly how is not important—and then run git fetch znotanto .所以在这种情况下,首先在那里创建那个分支——具体如何并不重要——然后运行git fetch znotanto

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM