Send a pull request on GitHub for only latest commit

后端 未结 7 1496
一整个雨季
一整个雨季 2020-11-29 14:45

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 t

7条回答
  •  生来不讨喜
    2020-11-29 14:53

    I ended up in a situation where I had forked a fork and wanted to submit a pull request back to the original project.

    I had:

    • orignal_project
    • forked_project (created from original project at SHA: 9685770)
    • my_fork (created from forked project at SHA: 207e29b)
    • a commit in my fork (SHA: b67627b) that I wanted to submit back to original project

    To do this, I:

    1. created a new branch from the SHA where the original project was forked
    2. pulled all from the original project
    3. cherry picked the commit I wanted to submit as a pull request
    4. pushed it all up to github

    The git commands were something like:

    1. git branch my-feature-request 9685770
    2. git checkout my-feature-request
    3. git pull https://github.com/original_project/original_project.git
    4. git cherry-pick b67627b
    5. git push origin my-feature-request

    Then I picked my-feature-request as the branch for my pull request to the original project.

提交回复
热议问题