Git push local master to remote specific branch [duplicate]

落爺英雄遲暮 提交于 2019-12-08 09:08:38

To push from your local master to a different remote branch, use:

git push origin master:branch

To have your friends pull this remote branch into their local master, they can use git pull as:

git checkout master
git pull origin branch

You can specify the remote branch name in git push command like this:

git push <remote> <local branch name>:<remote branch name>

So in your case, something like this:

git push origin master:smith-master

If you want to make this the default branch to push to, use the -u flag in addition.

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