Reputation: 1845
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)
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
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:
Just checkout pr1
, run git merge pr2
, then push with git push origin pr1
:
That should update the PR in GitHub. Try it out in Learn Git Branching!
Upvotes: 2