3 ms·
> being able to `gh pr checkout 123` is way easier than finding their fork, cloning and switching to the relevant branch. Of course it's easier than what you d
by seba_dos1 4y ago
> being able to `gh pr checkout 123` is way easier than finding their fork, cloning and switching to the relevant branch.
Of course it's easier than what you described, but that's not something you ever needed to do in order to checkout a pull request's branch; all you need to do it to checkout `pull/<ID>/head` from the repo PR has been made against - and that's what `gh pr checkout` does too.
(there's also `pull/<ID>/merge`, which contains the PR's branch already merged into target branch)
This works with GitLab too BTW, but you have to replace `pull` with `merge-requests`.
- petepete 4y agoWell, TIL. Thanks for the tip!