我如何将我的更改推送到远程分支 [英] How can I push my changes to a remote branch
本文介绍了我如何将我的更改推送到远程分支的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在一个master分支'master'上,我有1个提交
我想创建一个名为'new_remote'的新远程分支,并在那里推送我的提交?
$ git branch
* master
$ git remote
old_remote
$ git status
#在分支大师
#你的分支在1次提交之前是'old_remote / master'。
我想将我的提交推送到名为'new remote'的新分支
如果您当前正在使用本地分支 master ,并且新的远程分支尚未创建:
git checkout -b new_branch //创建本地分支(作为当前副本)
git push origin new_branch //将它推送到远程服务器
I am on a master branch 'master' and I have 1 commit ahead I want to create a new remote branch called 'new_remote' and push my commit there?
$ git branch
* master
$ git remote
old_remote
$ git status
# On branch master
# Your branch is ahead of 'old_remote/master' by 1 commit.
I want to push my commit to a new branch on remote called 'new remote' Thank you.
解决方案
If you are currently working on local branch master, and the new remote branch has not been created yet:
git checkout -b new_branch // creates a local branch (as a copy of the current)
git push origin new_branch // push it to the remote server
这篇关于我如何将我的更改推送到远程分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文