[英]how to push to develop branch not master?
每當我嘗試使用以下命令推送時,將創建的拉取請求將始終針對 master 分支
git push origin my_sample_branch
我已經嘗試設置我的上游
git push --set-upstream origin develop
但我仍然推到 master 分支。 怎么會?
試試這個命令語法:
git push <remote> <local_branch>:<remote_branch_name>
在您的示例中,例如:
git push origin my_sample_branch:develop
執行以下命令:
1.先切換分支git switch my_sample_branch
2.設置上游分支git branch -u origin/develop
3.直接push,會自動push到upstream分支git push
對了,可以通過命令git branch -vv
查看上游分支
試試這個:
git push origin your_local_branch : your_remote_branch
為我工作
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.