簡體   English   中英

如何在git中僅將當前分支從本地推送到遠程倉庫?

[英]How to push only current branch from local to remote repo in git?

我的本地倉庫有2個分支: masterdoing ,我僅在doing分支中創建提交,當我完成項目時,將其合並到master分支中。 當我結帳master分支並推送到遠程倉庫時,有2個分支被推送到遠程。 我怎樣才能只將master分支推送到遠程倉庫,以使doing分支的提交不會出現在遠程倉庫中?

您可以手動指定要推送的分支:

git push origin master

或者,您可以將git配置為始終只推送當前分支:

git config --global push.default simple

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM