Merge some commits in the submit requests to Github

I created a pull request on Github. I have 2 commits in a pull request. How (if possible) can I concatenate just the first commit and then create a second pull request for the second post.

Example: I have a pull request with commits A and B (in that order. B is the last commit). I want to concatenate only A with one pull request and then create a separate pull request to merge B. How can this be done.

+3


source to share


1 answer


Person A has repo A. Person B forks repo A for repo B with the aim of fixing issue 42. Person B creates a branch issue 42 on repo B, cracks the issue and commits. Person B creates a pull request for person A on repo A for branch 42.

Person A now sees that the pull request consists of two commits C1 and C2 and decides that they only want C1.

The correct thing here is for Person A to ask Person B to change his pull request so that it only contains C1. This preserves history correctly. So Person B can do something like



git branch bug42_c1 bug42^ # create new branch bug42_c1 on the ancestor of the tip of branch bug42

      

Person B can now submit a pull request for the bug42_c1 branch.

I hope this is a correct understanding of your question. If it is not, consider my answer and see how to rephrase your question for clarity.

+4


source







All Articles