推送本地分支到GitHub [英] Pushing a local branch up to GitHub
本文介绍了推送本地分支到GitHub的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我配置了Git,当我运行 git push
时,它会将更改推送到我的GitHub仓库。到目前为止,我只有一个主分支。
I have Git configured so that when I run git push
, it pushes changes to my GitHub repo. Until now I have only had a master branch.
然而,我现在已经创建了一个本地分支并使用它来承诺它:
However, I have now created a local branch and committed to it using:
git checkout -b my_new_branch
git commit
我现在想要做的是将这个分支上的更改推送到GitHub。我只是做一个git push?
What I would like to do now is push my changes on this branch to GitHub. Do I just do a git push?
当我第一次设置它时,我运行了:
When I first set it up I did run:
git config push.default current
推荐答案
我相信你正在寻找 git push origin my_new_branch
,假设你的origin远程配置为打你的github仓库。
I believe you're looking for git push origin my_new_branch
, assuming your origin remote is configured to hit your github repository.
这篇关于推送本地分支到GitHub的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文