如果它现在在我的mybrach中,那么“git push origin mybranch”会怎么做?

时间:2017-09-19 15:20:30

标签: git

提交后,我打算做git push进入上游, 但确实

git push origin mybranch

会引起任何变化吗?

1 个答案:

答案 0 :(得分:0)

很简单,它会将您的更改推送到已设置为名为origin的远程的任何存储库。

您可以使用

显示您拥有的遥控器以及它们指向的位置
git remote -v

当您自己运行git push时,它会推送到为您当前分支配置的默认远程。您可以使用the answers to this question找出它是什么。例如,如果:

git remote show upstream

包括以下行:

mybranch     pushes to mybranch

然后git push相当于git push upstream mybranch

更常见的是,默认遥控器无论如何都会origin,因此git pushgit push origin mybranch会做同样的事情。