首页 > 解决方案 > 如何推送开发分支而不是掌握?

问题描述

每当我尝试使用以下命令推送时,将创建的拉取请求将始终针对主分支

git push origin my_sample_branch

我已经尝试将我的上游设置为

git push --set-upstream origin develop

但我仍然推到主分支。怎么来的?

标签: gitgithubrepository

解决方案


试试这个命令语法

git push <remote> <local_branch>:<remote_branch_name>

在您的示例中,例如:

git push origin my_sample_branch:develop

推荐阅读