3 ms·
I love the gh tool. I still use `git switch` 95% of the time, but when a someone opens a PR on one of my repos being able to `gh pr checkout 123` is way easier
by petepete 4y ago
I love the gh tool. I still use `git switch` 95% of the time, but when a someone opens a PR on one of my repos being able to `gh pr checkout 123` is way easier than finding their fork, cloning and switching to the relevant branch.
The feature of gh I use most is `gh pr create`. It lets me combine the pushing of my current branch with creating a PR, allowing my to type the description using my text editor and has a nice interface for adding on reviewers etc. There's even a 'continue in a browser' button at the end if you want to add some screenshots.
It's an outstanding tool.
- 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!