4 ms·
GitHub pull requests actually are exposed as git objects (not the comments though, just the commits that make up the PR). If you want to see the commits in PR #
by eridius 9y ago
GitHub pull requests actually are exposed as git objects (not the comments though, just the commits that make up the PR). If you want to see the commits in PR #515 you can just `git fetch origin pull/515/head`, or `git fetch origin pull/515/merge` to get the merge commit GitHub created when testing if your PR can be merged into the target branch.
- pkamb 9y agoIs this possible if the PR is coming from a fork?
- petetnt 9y agoIt is.
- ThatGeoGuy 9y agoTo expand on this, you need to add the fork as an alternate remote (as opposed to origin), and then replace "origin" in the command posted prior.
- pkamb 9y agoSo it's not possible from a fork, if you've only added the original repo as your single remote? Currently I add the random person's fork as a remote to inspect/modify their PR branch. Was hoping for some GitHub magic to eliminate this step.
- eridius 9y agoIt is possible. You can specify a URL instead of a remote name for `git fetch`.
- mook 9y agoI thought it was in the PR destination repository (since they are under that repository's /pull namespace). You'd need to add the alternate remote if it's a PR into a fork (as opposed to from it), no?
- ThatGeoGuy 9y agoYou are absolutely correct. My apologies, as I understood the problem as "I have a fork and want to receive pull requests". This can be a pretty common setup for some git workflows. Everybody makes a fork and takes / pushes pull requests or branches from their fork to others. The main advantage would be that if you have a lot of branches they don't all have to be on upstream and you don't need to have upstream permissions for everyone to push branches or changes to. Nonetheless, I can see why my comment raised some confusion.