Send a pull request on GitHub for specified commit - ourbeehive/ourbeehive.github.io GitHub Wiki

问题描述:

fork了某个repo后自己做了修改,然后想pull request某个commit,但是默认pull request只能pull所有的commits

解决方法:

从upstream创建一个新的branch,然后将指定commit push到这个branch中,从这个branch中做pull request操作

详细步骤:

>git remote add upstream <upstream git repository>
>git remote update
>git checkout -b upstream upstream/master
>git cherry-pick <SHA hash of commit>
>git push origin upstream
-switch upstream branch in github and do pull request work

Ref

1.send-a-pull-request-on-github-for-only-latest-commit