在Github上更改PR的源代码分支 [英] Changing source branch for PR on Github
问题描述
在尝试重新绑定它时,我注意到所有这些更改都被推送了进入这个拉取请求 - 这是因为您可以简单地通过推送到用户名/回购的主分支添加更多的提交
- 您可以在提交请求之后更改请求的源分支
我看到你可以编辑基本分支,但这显然不是我所追求的。
AFAIK,创建合并请求后无法更改源分支。相反,您必须创建一个新的分支。
为了将来的参考,已建立的最佳实践是在进行任何提交之前创建一个新的分支。您不应该直接向主人承诺,尤其是在为团队项目做出贡献时。
$ b
您可以简单地通过在用户名/回购站点推送到主分支来添加更多提交
更准确地说,对PR的目标分支所做的任何更改都会自动包含在PR中。
I accidentally created a pull request from the master-branch of my fork of a repo.
While trying to rebase it I noticed that all of these changes were pushed into that pull request — due to the fact that you can simply Add more commits by pushing to the master branch on username/repo
- Can you change the source branch of a pull request after the pull request has been submitted?
I see you can edit the base branch, but that's obviously not what I'm after.
AFAIK, you cannot change the source branch after creating a Pull Request. You have to create a new one instead.
For future reference, the established best practice is to create a new branch before making any commits. You should not commit directly to master, especially when contributing to team projects.
Side note:
you can simply Add more commits by pushing to the master branch on username/repo
More correctly, any changes to the target branch of a PR are automatically included in the PR.
这篇关于在Github上更改PR的源代码分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!