我有一个特定的提交,我想将其贡献到我在 github 上 fork 的存储库。 我假设这样做的机制是“pull 请求”。 但是,当我尝试这个时,我只能请求我的整个分支。 我不希望请求其他提交,因为它们不相关。 知道我该怎么做。
最后一次提交 b50b2e7 是我希望 pull 请求的唯一提交。 无论如何,我可以做到这一点,还是所有提交都相互依赖?
最佳答案
仅使用该更改创建一个新分支:
# If you haven't set up your remote yet, run this line:
# git remote add upstream https://github.com/konradjk/exac_browser.git
git fetch --all # Get the latest code
git checkout -b my-single-change upstream/master # Create new branch based on upstream/master
git cherry-pick b50b2e7 # Cherry pick the commit you want
git push -u origin my-single-change # Push your changes to the remote branch
然后从该分支创建 PR。
关于git - 如何 "pull request"一个特定的提交,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34027850/