如何在github上将一个pull请求分成两个不同的pull请求 [英] how to divide one pull request into two different pull request on github

查看:241
本文介绍了如何在github上将一个pull请求分成两个不同的pull请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将一个拉取请求分成两个拉取请求?
我在一个pull请求中提交了十次,我想将它们分成两个不同的pull请求,因为前六个提交与最后四个提交无关。
我用git使用Ubuntu操作系统。
因为我是git的新手,我想知道如何一步一步地输入git命令来做到这一点。
任何意见将不胜感激。

How can I divide one pull request into two pull requests? I committed ten times in one pull request, and I want to divide them into two different pull requests because the first six commits are unrelated to the last four commits. I use Ubuntu os with git. As I am new to git, I am wondering how to input git commands step by step to do that. Any advice would be be highly appreciated.

推荐答案

您基本上拥有在2中拆分分支这些图很好,所以不用担心复制它们。

You basically have a duplicate of Splitting a Branch in 2 The graphs there are good so not bothering to duplicate them.

首先创建第二个分支指向你的第六次提交

First create a second branch pointing at your sixth commit

git branch branch2 HEAD~4

git branch branch2 COMMIT_6_SHA

branch2现在已经完成并准备好为前6次提交创建一个请求。

branch2 is now done and ready to create a pull request for the first 6 commits.

现在你想用 git rebase --onto 来移动现有的分支和其他4个提交,这样他们就可以挂上你的上游 p>

Now you want to use git rebase --onto to move your existing branch with the other 4 commits so they are hanging off your upstream

git rebase --onto @{u} branch2

就是这样。

这篇关于如何在github上将一个pull请求分成两个不同的pull请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆