没有指定分支的“git push”的默认行为 - Default behavior of “git push” without a branch specified

08/11 05:08
阅读数 64

问题:

I use the following command to push to my remote branch: 我使用以下命令推送到我的远程分支:

git push origin sandbox

If I say 如果我说

git push origin

does that push changes in my other branches too, or does it only update my current branch? 这会推动我的其他分支的变化,还是只更新我当前的分支? I have three branches: master , production and sandbox . 我有三个分支: masterproductionsandbox

The git push documentation is not very clear about this, so I'd like to clarify this for good. git push文档对此并不十分清楚,所以我想澄清这一点。

Which branches and remotes do the following git push commands update exactly? 哪些分支和遥控器执行以下git push命令更新?

git push 
git push origin

origin above is a remote. 上面的origin是遥远的。

I understand that git push [remote] [branch] will push only that branch to the remote. 据我所知, git push [remote] [branch]只会将该分支推送到远程。


解决方案:

参考一: https://stackoom.com/question/3yi2/没有指定分支的-git-push-的默认行为
参考二: https://oldbug.net/q/3yi2/Default-behavior-of-git-push-without-a-branch-specified
展开阅读全文
git
打赏
0
0 收藏
分享
加载中
更多评论
打赏
0 评论
0 收藏
0
分享
在线直播报名
返回顶部
顶部