[英]How to push only current branch from local to remote repo in git?
我的本地倉庫有2個分支: master
和doing
,我僅在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.