只在GitHub上发送一个pull请求,仅用于最新的提交 [英] Send a pull request on GitHub for only latest commit

查看:110
本文介绍了只在GitHub上发送一个pull请求,仅用于最新的提交的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在github上分配了一个项目,并且成功地对我的本地主人进行了更改,并在github上推动起源。我想发送一个拉取请求,但只想包含最后一次提交。 github.com上的pull请求用户界面显示最后9次提交,我不知道如何过滤掉。



我试图了解我是否应该创建一个新的本地分支,检查出来,并以某种方式重置或重新上游?然后应用我的最后一次提交从我的主人id到新的本地分支,并将其用于拉请求?



我试图让概念正确,并找出正确的命令行来做我所需要的。

cherry-


注意:您可能需要在结帐前添加这些提交。 cherry-pick命令

git remote add upstream< git repository>



git remote update




  git checkout -b<新分支名称>上游/主

git cherry-pick<提交的SHA哈希>

git push origin< new-branch-name>

之后,您会看到 < new-branch-name> ;在github上的 分支,切换到它并可以提交你想要的更改的请求。


I forked a project on github and am successfully making changes to my local master and pushing to origin on github. I want to send a pull request, but only want to include the last commit. The pull request UI on github.com shows the last 9 commits and I don't know how to filter that down.

I was trying to understand if I should create a new local branch, check that out and somehow reset or rebase to upstream? Then apply my last commit from my master by id to the new local branch and use that for the pull request?

I'm trying to get the concepts right and figure out the right command lines to do what I need.

解决方案

You need to basically create a new branch & cherry-pick the commits you want to add to it.

Note: you might need these before the checkout/cherry-pick commands

git remote add upstream <git repository>

git remote update

git checkout -b <new-branch-name> upstream/master

git cherry-pick <SHA hash of commit>

git push origin <new-branch-name>

Afterwards, you will see <new-branch-name> branch on github, switch to it and can submit the pull request with the changes you want.

这篇关于只在GitHub上发送一个pull请求,仅用于最新的提交的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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