将一个提交子集作为github pull请求呈现在分支上 [英] Presenting a subset of commits on a branch as a github pull request

查看:78
本文介绍了将一个提交子集作为github pull请求呈现在分支上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在github上创建了一个项目.

I forked a project on github.

我提交了1,2,3,4& 5在我的主分支上.

I made commit 1,2,3,4 & 5 on my master branch.

我要提交提交2& 5作为向上游的拉取请求,这样当上游接受并与上游同步分支时,不会发生任何冲突.

I want to present commit 2 & 5 as a pull request to upstream, in such a way that when upstream accepts, and I sync my branch with upstream, I don't get any conflicts.

我可以通过哪些方式来做到这一点?

What are the various ways I could do that?

推荐答案

您可以:

  • fetch the upstream branch
  • rebase --interactive your branch on top of it, making sure commit 2 & 5 are re-ordered as commit 1 & 2
  • submit those 2 commits as pull requests to the fork queue of upstream project.

这篇关于将一个提交子集作为github pull请求呈现在分支上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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