Skip to content

Instantly share code, notes, and snippets.

@thamht4190
Created September 13, 2018 04:11
Show Gist options
  • Save thamht4190/8fcc446d4cf328f4952a07aa48335fa5 to your computer and use it in GitHub Desktop.
Save thamht4190/8fcc446d4cf328f4952a07aa48335fa5 to your computer and use it in GitHub Desktop.
Github move a patch to a PR
I have to move a PR from this repo to another repo with slight difference in structure. That was how I did:
1. Go to github page of the PR, add .patch to url to get the patch file
E.g: http://github.com/<name>/<repo>/pull/<id>.patch
2. Download as <id>.patch then open that file, edit changed file path (in old repo) to new file path (in new repo).
You don't need to do this step if 2 repos have the same structure.
3. git am -3 <id>.patch
the -3 will do a three-way merge if there are conflicts.
At this point you can do a git mergetool if you want to go to a gui or just manually merge the files using vim
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment