7 ms·
Ask HN: When did GitHub replace standard Git commands with the “GitHub CLI?”
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`. Underneath, there's some subtle advertising: "Work fast with our official CLI. _Learn more._"
This is of course useless to me, and to any other developer who prefers to use standard tooling rather than proprietary lock-in stuff.
I don't begrudge Microsoft shipping a GH CLI as an optional thing, but shifting workflows away from the standard client is one of those changes that doesn't serve users, but rather serves some PM's KPIs.
EDIT: based on the "not on my machine" responses here, it's clear that I'm on some branch of an A/B test. These are the only three options now presented in my GH web UI - all the rest have disappeared (https://imgur.com/P7llsVo):
1. Checkout with the GitHub CLI
2. Checkout with GitHub Desktop
3. An ad for buying Codespaces for this public repo
- tjpnz 4y agoEmbrace. Extend. Extinguish.
- jrockway 4y agoThat was a noble business strategy in the late 90s. The only thing Microsoft has managed to extinguish in the last 20 years is an ad-free start menu.
- 2devnull 4y agoI don’t know about that. A lot of folks seem to have ditched real Linux when Microsoft added Linux in windows. Docker seems to have played a role also.
- kthartic 4y agoThis sounds like Google tbh. Don't think Microsoft is really notable for this anymore.
- biorach 4y agoyawn. get some new material.
- tpoacher 4y agoAlas, it wasn't comedy.
- goku12 4y agoI just tried it now. The default is still HTTPS when signed out and SSH when signed in. The `gh` workflow seems to be the default only for those who have authenticated using the tool.
- Aaron2222 4y agoSame here[0], though I do have the GitHub CLI set up. EDIT: Never mind. OP was referring to checking out from the PR page, which does only show the GitHub CLI option. [0]: https://imgur.com/S3gxl1x https://imgur.com/S3gxl1x [1]: https://imgur.com/P7llsVo https://imgur.com/P7llsVo
- strix_varius 4y agoI don't have the tool installed, so I suspect it's more likely that we're on different branches of an A/B test.
- thiago_fm 4y agoI've never used it
- Cthulhu_ 4y agoNothing that can't be fixed with a browser addon, or using a local client or terminal commands to figure out what to put into a `git checkout`.
- nfinished 4y agoIt's tiring how reactionary the average HN commentor/contributor can be. It's not a replacement for standard git commands, it's a set of tools for interacting with GitHub. There are other commands for interacting with repos in GitHub specific ways so leaving out cloning a GitHub repo would have felt like a strange omission. Of course they're going to promote their own tool on their own website, that is generally how businesses work. You don't have to use it, no one is making you use it.
- deleted 4y ago[deleted]
- Thristle 4y agowhile a PR doesn't exist in git it is no more than a branch with extra data attached to it I've been using GH at work and personally for a while now and i never wanted/needed to use the GH CLI/GUI, the IDE will cover you if you need it to. If they really removed the easy to use copy button it would be annoying but calling it "extinguish" is definetly some HN warrior attitude. They didn't remove it though, just moved it a bit and OP is being a bit dramatic
- strix_varius 4y ago> It's tiring how reactionary the average HN commentor/contributor can be. On the contrary, HN is great because most users stick to the subject of discussions rather than devolving into ad-hominem attacks. It's curious that your account was created exactly one minute after this post was posted, for precisely one insulting comment.
- micromacrofoot 4y agoThey're right though. HN users are generally only viewed favorably by other HN users, it's a community that is dominated by reactionary pedants. I say this realizing that I too am a reactionary pedant.
- nfinished 4y agoI finally made an HN account just for this comment. Feel free to look up the username, it's not a throwaway.
- clintonb 4y agoThis post reads as unnecessary FUD. You aren’t forced to use the CLI. If you choose to use it, some workflows are simpler. The only part of the commit response I care about is the URL to create/view a pull request. It’s pretty easy to ignore the rest.
- qbasic_forever 4y agoFor the very reason that you're still looking up how to checkout a pull request, git's CLI is not super intuitive and the gh tools appears to be trying to simplify it for their customers. Also realize that the entire concept of a pull request is foreign to git (it is a GitHub invention, Linus never designed git for pull request style development), so they likely want to add tooling to make it easier to use.
- strix_varius 4y agoChecking out the branch via git is a single command that's neither longer nor more complicated than the "gh cli" version. For years, it's been the default command in a single-click "copy" field under the "code" dropdown in a PR, not because git is complicated and anyone needs to "look up" the command, but because that's a fast and efficient way to grab a branch. Replacing the `git` single-liner with a `gh` single-liner does nothing for the user but make them dependent on the `gh` tool.
- eli 4y agoCounterpoint: git is complicated, it's commands are IMHO inconsistent, and users very frequently need to look up how to do relatively common tasks.
- voytec 4y agoHaving to use per-vendor tools for git seems more complicated than using single tool for all Git services. I don't mind gh as an additional tool but OP's description suggests that Microsoft tries to replace git with gh entirely.
- qbasic_forever 4y agoWhat git command tells you the fork on github.com that wants to send you a pull request? (Hint: there is none, only the gh tool and GitHub api know it)
- Thristle 4y agoJust checked to see if I just missed it when i use GH when cloning a repo you get 3 tabs instead of 2 before which are HTTPS,SSH,GH CLI based on the gh command you wrote you were trying to checkout a branch related to a PR so i tried that on top there is now the `Checkout with github CLI` section but underneath it there is `Checkout with Git` with the HTTPS or SSH options yes, they changed the layout and put their CLI on top (which came before microsoft btw, unrelated to them) but there is still the original workflow right there Either OP is on some A/B bucket where they "deleted" git or OP didn't bother to look
- strix_varius 4y agoOP is definitely on an A/B bucket, because I get two tabs: Local & Codespaces. Local has two options: "Checkout with the GitHub CLI" and "Checkout with GitHub Desktop." Codespaces is an ad for buying codespaces for this repo (none exist).
- rjh29 4y agoIf you usually use SSH but are logged out, the SSH tab disappears, which might explain why Gitlab CLI is being shown.
- clcaev 4y agoThis confused me as well. A better user experience would leave the ssh tab, and explain why it may not work for a particular user?
- bminor13 4y ago> shifting default workflows away from the standard client is one of those changes that doesn't serve users There is no "default workflow" for git - Git can be used in a variety of ways; everyone has their own personal preference, and some of these workflows are shaped by interacting with systems like Github/Gerrit/etc. Every place I've ever worked at has either: - a home-grown wrapper around git to make common operations easy - a recommended set of git aliases around common operations The fact that Github has created their own to interact with their own system is a net win for individuals/organizations who would otherwise need to spend time scripting their own. Of all the capabilities of the Github CLI, `gh pr checkout` is the only one I use, because it makes it easy to fetch a PR locally by ID without configuring a remote per fork. I'm pretty glad I didn't have to write this myself.
- yamtaddle 4y ago> > shifting default workflows away from the standard client is one of those changes that doesn't serve users > There is no "default workflow" for git The default workflow, as in what Github promotes. Github's default, not git's. That's what's meant.
- secretsatan 4y agoAs a sub menu from the "<> Code" Button? I have 3 tabs, HTTPS, SSH and this new Github CLI tab, but it remembers the last tab selected and always shows that
- petepete 4y agoI 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!
- rychco 4y agoIt's not a replacement for git. I used the github cli recently to search for all repos in a specific language, above a certain star count, no archives, & no forks; then piped it into other commands to clone, rename, and archive the repos. It's a very convenient way to interact with github features without visiting the site in a browser.
- paweladamczuk 4y agoGolly, are we in the extinguish phase already?
- a2tech 4y agoMicrosoft 101--embrace, extend, extinguish. We've seen the GitHub embrace step, now we're seeing the extend part, next comes the lock in and closing off of GitHub.
- LinuxBender 4y agoThe only odd thing I am seeing is network congestion on their side. It seems the bog standard git tool is working as expected for me. I am not seeing any advertisements for a new tool.
- raydiatian 4y agoA/B testing is the worst. YouTube tried out the idea of going straight from app-load into their TikTok mode (or whatever it’s called) on me a handful of times. I had a feeling they were collecting as much data as possible so every time I just uninstall the app for 24 hours. “Bad dog, no treat.”
- _ache_ 4y agoI not sure to understand but GH CLI is a free software (MIT License). If you already use Github, there is no more proprietary software. https://github.com/cli/cli https://github.com/cli/cli
- verdverm 4y agoIt's still vendor lock-in and only works for one code host. git doesn't care who hosts your code
- xg15 4y agoI do hope the endgame isn't to get rid of git completely and switch tge repos to some proprietary format.
- 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.
- karmakaze 4y agoI'd heard of GitHub Desktop, didn't know about GH CLI. Don't use either, nor the git/GitHub IDE integration other than 'blame' to show commit hashes/dates on lines. Also use IDE to do 3-way diff conflict resolution, but initiate/commit/continue from command-line. Do all git mutations from command-line using `git`. One useful tip is that you can go to github.com/<org-repo>/pull/<branch-name> rather than PR# and it will redirect.
- undopamine 4y agoI've found Github Desktop highly useful and intuitive. Is there a specific reason people don't use it?