[英]Does `git push` work as shorthand for `git push origin newfeature`?
I note that the default behaviour of git push origin
is to "push all branches with same local and distant name". 我注意到
git push origin
的默认行为是“推送具有相同本地和远程名称的所有分支”。
If I create a new branch newfeature
and check it out, will git push
push the branch to origin
by default? 如果我创建一个新的分支
newfeature
并检查出来, git push
会默认将分支推送到origin
吗?
Or do I need to use git push origin newfeature
even when it's checked out? 或者我是否需要使用
git push origin newfeature
即使它已经签出?
Further, how does the command git push HEAD
relate to this? 此外,命令
git push HEAD
如何与此相关?
By default, it will push newfeature
if and only if a branch called newfeature
already exists on the remote. 默认情况下,当且仅当遥控器上已存在名为
newfeature
的分支时,它才会推送newfeature
。
You can change this by using the push.default
config variable. 您可以使用
push.default
配置变量来更改此设置。
git push HEAD
is essentially a shorthand for git push <name of checked out branch>
if you have a branch checked out. git push HEAD
本质上是git push <name of checked out branch>
的简写,如果你有一个分支签出。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.