你如何推动一个Git分支(而不是其他分支)? [英] How do you push just a single Git branch (and no other branches)?
本文介绍了你如何推动一个Git分支(而不是其他分支)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用本地git存储库。有两个分支 master
和 feature_x
。
我想将 feature_x
推送到远程仓库,但我不想推送 master
分支上的更改。
请问我的 feature_x
中的 git push origin feature_x
分支( feature_x
分支已经存在于远程)work?
我不想在我的盒子上测试这个,因为我现在无法推送给主人。
解决方案
是的,只需执行以下操作即可:
git checkout feature_x
git push origin feature_x
I am working on a local git repository. There are two branches, master
and feature_x
.
I want to push feature_x
to the remote repo, but I do not want to push the changes on the master
branch.
Will a git push origin feature_x
from my feature_x
branch (feature_x
branch already exists on remote) work?
I do not want to test this on my box, because I cannot push to master right now.
解决方案
yes, just do the following
git checkout feature_x
git push origin feature_x
这篇关于你如何推动一个Git分支(而不是其他分支)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文