Default behavior of “git push” without a branch specified

前端 未结 12 1388
眼角桃花
眼角桃花 2020-11-22 05:32

I use the following command to push to my remote branch:

git push origin sandbox

If I say

git push origin

12条回答
  •  借酒劲吻你
    2020-11-22 06:13

    Here is a very handy and helpful information about Git Push: Git Push: Just the Tip

    The most common use of git push is to push your local changes to your public upstream repository. Assuming that the upstream is a remote named "origin" (the default remote name if your repository is a clone) and the branch to be updated to/from is named "master" (the default branch name), this is done with: git push origin master

    git push origin will push changes from all local branches to matching branches the origin remote.

    git push origin master will push changes from the local master branch to the remote master branch.

    git push origin master:staging will push changes from the local master branch to the remote staging branch if it exists.

提交回复
热议问题