a2f0
a2f0

Reputation: 1845

Is it possible to merge into a pull request

Let's I have two commits in a pull request; one is a descendant of another. For example;

(descendant)

https://github.com/common-workflow-language/cwltool/commit/a42ef0604e1957c8c91fde26a2f939444df5009b

(parent)

https://github.com/common-workflow-language/cwltool/pull/64/commits/e2231e1d1eabffa68bcfdc2e0fbe2419a7204b07

How would one go about merging the descendant into the pull request? Presumably I have to do something like pull the descendant into the parent and then re-commit? I can't seem to get this working. I've tried various approaches (i.e. cherry picking), and can't seem to do it right. I appreciate your help and expertise.

Upvotes: 0

Views: 59

Answers (1)

Ajedi32
Ajedi32

Reputation: 48368

A pull request is just a request to merge one branch into another. You can update a pull request at any time by changing the commit the source branch for that PR is pointing to. So to merge the "descendant" pull request into its parent, just merge the source branch for the descendant pull request into the source branch for the parent PR.

E.g. if you have pr1, the source branch for the parent PR, and pr2, the branch for the descendant PR:

Commit graph with pr1 and pr2

Just checkout pr1, run git merge pr2, then push with git push origin pr1:

After merge and push

That should update the PR in GitHub. Try it out in Learn Git Branching!

Upvotes: 2

Related Questions