我注意到 git push origin
的默认行为是“推送具有相同本地和远程名称的所有分支”。
如果我创建一个新分支newfeature
并查看它,git push
会默认将分支推送到origin
吗?
或者我是否需要使用 git push origin newfeature
即使它已 checkout ?
此外,命令 git push HEAD
与此有什么关系?
最佳答案
默认情况下,它会推送 newfeature
当且仅当一个名为 newfeature
的分支已存在于 Remote 上。
您可以使用 push.default
更改此设置配置变量。
git push HEAD
本质上是 git push <name of checked out branch>
的简写如果你有一个分支 checkout 。
关于git - `git push` 是否用作 `git push origin newfeature` 的简写?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6470274/