简体   繁体   中英

Github pull request exclude 'merge branch' commits

My pull request consists of several commits. Among these commits there are some in which I just merged the master to the branch. So my pull request looks like this:

Commits on Apr 1, 2015
  Fix issue1

Commits on Apr 2, 2015
  Fix issue2

Commits on Apr 3, 2015
  Fix issue1
  Fix issue2
  Merge branch 'mybranch' of...

I would need only to have commits Fix issue1 and Fix issue2 from Apr 3 in my pull request, and want to get rid of the merge branch commits. Merge branch commits are not needed since those are already there in the upstream where I want to pull.
Github doesn't provide me an interface to cherry pick commits from an existing pull request..
What is the best practice to deal with this situation?

If you have a commit that already in your target branch fell free to commit, nothing will actually be committed since its already in the target branch.

Next time you can use git hunks to add only the things that you need.

git add -p 

it will open editor with the options to only add what you want to add.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM