警告:未将分支主机设置为自己的上游 [英] warning: Not setting branch master as its own upstream
问题描述
我正在尝试将git分支设置为上游,但低于警告值.
I am trying to set git branch upstream but getting below warning.
git checkout master
git branch --set-upstream-to master
警告:不将分支主机设置为自己的上游.
warning: Not setting branch master as its own upstream.
我该如何解决?
这是否意味着它已经在跟踪正确的远程分支 master
?
Does that mean it already being tracing correct remote branch master
?
推荐答案
应为:
git branch --set-upstream-to origin/master
但是,如果存在 origin/master
,则结帐应该已经对其进行了跟踪.
But if origin/master
is there, the checkout should have tracked it already.
如果未找到
< branch>
,但恰好在一个具有匹配名称和-no-guess
未指定,等同于:
If
<branch>
is not found but there does exist a tracking branch in exactly one remote (call it<remote>
) with a matching name and--no-guess
is not specified, treat as equivalent to:
$ git checkout -b <branch> --track <remote>/<branch>
在Git 2.23+中,您将使用 git switch master
而不是结帐
,正如我在此处提到的.
With Git 2.23+, you would use git switch master
instead of checkout
, as I mentioned here.
这篇关于警告:未将分支主机设置为自己的上游的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!