我正在尝试将 git 分支设置为上游,但低于警告。
Command
git checkout master
git branch --set-upstream-to master
警告:未将分支主设置为其自己的上游。
我该如何解决?
这是否意味着它已经在跟踪正确的远程分支master
?
那应该是:
git branch --set-upstream-to origin/master
But if origin/master
在那里,那个checkout https://git-scm.com/docs/git-checkout#_description应该已经追踪到了。
If <branch>
未找到,但在一个远程中确实存在一个跟踪分支(称之为<remote>
) 具有匹配的名称和--no-guess
未指定,视为等同于:
$ git checkout -b <branch> --track <remote>/<branch>
使用 Git 2.23+,您可以使用git switch master https://stackoverflow.com/a/57066202/6309代替checkout
, as I 这里提到 https://stackoverflow.com/a/58124339/6309.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)