Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我注意到默认行为git push origin是“推送具有相同本地和远程名称的所有分支”。
git push origin
如果我创建一个新分支newfeature并检查它,是否会默认git push将分支推送到?origin
newfeature
git push
origin
或者我是否需要在git push origin newfeature结帐时使用?
git push origin newfeature
此外,该命令git push HEAD与此有何关系?
git push HEAD
默认情况下,newfeature当且仅当newfeature远程上已经存在一个名为的分支时,它才会推送。
您可以使用push.defaultconfig 变量来更改它。
push.default
git push HEAD本质上是git push <name of checked out branch>如果您已签出分支的简写。
git push <name of checked out branch>