3 ms·
There's a lot of reasons it's possible, but the one that sticks out is that the repo owner needs to be able to modify the commit before the PR is merged. AFAIK,
by RulerOf 6y ago
There's a lot of reasons it's possible, but the one that sticks out is that the repo owner needs to be able to modify the commit before the PR is merged. AFAIK, the way that's done is by incorporating the remote repo's commit history into the destination repo underneath a pr-specific branch, which naturally brings all of the commits themselves into the repo's git database.
- fireattack 6y agoFollow up question, are these commits or pr-specific branch accessible in target repo's `git` (not GitHub)?
- gizmo686 6y agoYes. You can get it with: git fetch <remote> refs/pull/<pr>/head My git config has the alias: pr = !f() { git fetch $1 refs/pull/$2/head:pr/$1/$2; } ; f which will create a local branch corresponding to the provide PR. This is useful for evaluating large PRs that would be difficult to fully evaluate with just the online UI.
- RulerOf 6y agoYes, but I don't know if you have to track the branch first or not in order to pull down the data into your local repo. But this is exactly how merging a PR locally[0] works. 0: https://docs.github.com/en/free-pro-team@latest/github/collaborating-with-issues-and-pull-requests/checking-out-pull-requests-locally https://docs.github.com/en/free-pro-team@latest/github/colla...