Send a pull request on GitHub for only latest commit

后端 未结 7 1493
一整个雨季
一整个雨季 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 15:06

    I had already made the commit which I wanted to be able to isolate as a pull request back onto the current branch.

    So I checked out a new branch

    git checkout -b isolated-pull
    

    And here's where my solution differs from @Kevin Hakanson's, as I need to reset this branch to the place in the history I want to diff from

    git reset --hard [sha-to-diff-by]
    

    And cherry-pick the commit from which I want to create an isolated pull request

    git cherry-pick [my-isolated-commit-sha]
    

    Finally push it up to the remote

    git push origin isolated-pull
    

    And pull request dat shi.

提交回复
热议问题