我如何将拉取请求合并到我的github项目的特性分支中? [英] How do I merge a pull request into a feature branch of my github project?

查看:413
本文介绍了我如何将拉取请求合并到我的github项目的特性分支中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人已经从fork中向我的GitHub项目提交了一个pull请求。我宁愿将这些更改合并到一个功能分支中,以便在将最终产品合并到主设备之前进行一些小修改,而不是直接合并到主设备中。如果可能,我希望GitHub向提交者表明请求已被接受(我想鼓励并认可贡献!)。这可能吗?我怎么去解决这个问题?

解决方案

这是可能的!首先创建一个功能分支:

  $ git checkout -b我的功能

然后将拉取请求的更改合并到您的新功能分支中:

  $ git pull https://github.com/user/fork.git 

在一个新的提交中进行小调整:

$ $ p $ $#make changes
$ git commit -am我的小改动

然后将您的功能分支合并到master中,并推送到github。

  $ git checkout master 
$ git merge my-feature
$ git push origin master

这会反映在github.com上的pull请求中,如果您愿意,可以发表评论感谢提交者。


Someone has submitted a pull request to my GitHub project from a fork. Rather than merging directly into master, I would prefer to merge the changes into a feature branch so that I can make some minor edits before merging the final product into master. If at all possible, I'd like GitHub to indicate to the submitter that the request was accepted (I want to encourage and recognize contributions!). Is this possible? How do I go about it?

解决方案

This is possible! First create a feature branch:

$ git checkout -b my-feature

Then pull and merge the pull request's changes to your new feature branch:

$ git pull https://github.com/user/fork.git

Make your minor adjustments in a new commit:

$ # make changes
$ git commit -am "my minor changes"

Then merge your feature branch into master and push to github.

$ git checkout master
$ git merge my-feature
$ git push origin master

This will be reflected on the pull request on github.com, and you can leave a comment thanking the submitter if you like.

这篇关于我如何将拉取请求合并到我的github项目的特性分支中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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