繁体   English   中英

如何推动开发分支而不是掌握?

[英]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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM