如何“拉出请求”一个具体的提交 [英] How to "pull request" a specific commit
问题描述
我有一个特定的提交,我想贡献给我在github上分发的仓库。
我假设这样做的机制是拉动请求。
但是,当我尝试这个时,我只能拉我的整个分支。
我不想因为它们不相关而要求其他提交。
任何想法我都可以做到这一点。
I've got a specific commit which I would like to contribute to a repository I have forked on github. I assume the mechanism to do so is a "pull request". However when I try this I can only pull request my whole branch. I do not wish to pull request the other commits as they are not relevant. Any idea how I can do this.
最后一次提交b50b2e7是我希望提交请求的唯一提交。
无论如何,我可以做到这一点,或所有提交依赖于对方?
The last commit b50b2e7 is the only commit I wish to pull request. Anyway I can do this or are all commits dependent on each other?
推荐答案
创建一个新的分支只需要更改:
Create a new branch with just that change:
$ git fetch --all
$ git checkout -b my-single-change upstream/master
$ git cherry-pick b50b2e7
$ git push -u origin my-single-change
然后从该分支创建PR。
Then create the PR from that branch.
以上假设您已将上游
设置为远程。如果没有,请首先执行此操作:
The above assumes you've set up upstream
as a remote. If not, do this first:
$ git remote add upstream https://github.com/konradjk/exac_browser.git
这篇关于如何“拉出请求”一个具体的提交的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!