Push a Git branch to remote without checking the branch out

送分小仙女□ 提交于 2020-01-05 08:35:07

问题


Is there a way to push a branch to a Git remote without checking that branch out first?

Say I am on the master branch, and there is a release branch that I want to push to the remote, is there a way to push the release branch to the Git remote without having to check it out first?


回答1:


Try this:

git push -u origin new_branch_name



来源:https://stackoverflow.com/questions/51342767/push-a-git-branch-to-remote-without-checking-the-branch-out

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!