Scenario: you're assigned to review a pull request. It may have side-effects, so you want to build it locally to see it run for yourself. How do you do that?
Here's what I do:
- From my local git client I run
git remote add <user> <git-url>
. This creates a new remote (eg "origin" or "upstream") corresponding to the PR author's fork. - I create branch off of whatever the PR is merging into, usually "master".
- I pull in the changes from the remote branch,
git pull <user> <branch>
wherebranch
corresponds to whatever is shown in the PR.
Now my client should be synced to the contents of the PR and we're off.
I don't like that workflow. Can I borrow yours? What do other people do in this scenario?
I've heard about appending .patch
to the PR URLs to get a patch file, but not quite sure how to streamline that. Help!