2 ms·
> Today I went to check out a colleague's branch, and noticed the standard `git` one-liner has been replaced with a `gh` one-liner: `gh pr checkout 1234` Wait,
by xg15 4y ago
> Today I went to check out a colleague's branch, and noticed the standard `git` one-liner has been replaced with a `gh` one-liner: `gh pr checkout 1234`
Wait, I'm a bit confused. Where you on the "branch" or on the "pull request" UI? If they replaced the instructions to check out an arbitrary branch, I could understand the outrage. But this looks like a command to check out a pull request. To my knowledge, there is no standard git command to do this. (Because "pull requests" are a github/gitlab/etc concept not a git concept as the sibling comments explained)
If they just added instructions for the github client for things you can't do with the normal git CLI, that seems perfectly reasonable to me.
- kevincox 4y agoYou can pretty easily check out a PR using the regular Git CLI. GitHub adds refs for pull requests that you can fetch. git fetch origin pull/ID/head:BRANCH_NAME From: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally https://docs.github.com/en/pull-requests/collaborating-with-... Sure, the whole workflow isn't a "standard Git workflow" but they could easily provide a command that works with the standard Git CLI.
- seba_dos1 4y ago> but they could easily provide a command that works with the standard Git CLI. And that's what they used to do there.