Home > database >  How to clone and merge a specific pull request made by other in to my own repository locally
How to clone and merge a specific pull request made by other in to my own repository locally

Time:01-02

What will be the way of clone the pull request into my repo locally? https://github.com/RoboSherlock/robosherlock/pull/215 This is the pull request I want to merge into my fork or locally. I search some questions here but that looks different, I want to merge these pull requests into my repo. This pull request is in the master branch but I have to merge in the noetic branch.

CodePudding user response:

Key fact: The last commit in the pull request branch is bb7efd3.

So the direct way to do this is that you would get onto the noetic branch and merge bb7efd3 into it. You will have one small merge conflict to resolve and then you're all set.


I think if I wanted to do this through a pull request I would get onto noetic, rebase the two commits of the original pull request branch onto it, call that a new branch, push my new branch, and create the pull request. Here, I'll show you:

git switch noetic
git rebase --onto noetic bb7efd3~2 bb7efd3
# ... resolve merge conflict and finish rebase ...
# ... you are now on a detached head ...
git switch -c newbranch

As you can see, the result is exactly the topology you want — a new branch off of noetic that looks like the old pull request branch:

% git log --oneline -n 3 mybranch
5242afa (HEAD -> mybranch) Fix wrong constructor name
3ef17e6 RegionFilter with markers
84cc713 (origin/noetic, noetic) changed default demo pipeline. no tf lookups anymore to avoid tf lookup errors in the tutorials

So now you can push newbranch and form a pull request in the ordinary way.

  • Related