27 ms·
GitHub CLI 1.0
- dberg 6y agoIs this proof that regular git commands are too difficult to use? I also wonder what this is going to do for folks not using Github as now CLI users are going to "unlearn" all their traditional git commands.
- rolfvandekrol 6y agoIt seems like this is not a CLI for git, but for the Github specific stuff, such as issues and pull requests.
- pbalau 6y agoNo, is a complement. See [0]. Basically allows doing from cli things you could only do from the UI before (without writing your custom scripts). [0] https://cli.github.com/manual/index https://cli.github.com/manual/index
- cfors 6y agoIt's not a replacement for git, its to interact with the GitHub UI over the command line. There are 3 main commands from the CLI you can issue: gh CORE COMMANDS issue: Create and view issues pr: Create, view, and checkout pull requests repo: Create, clone, fork, and view repositories I still use the git cli and the github UI, but sometimes just view open PR's from the my terminal if I'm already in there.
- Galanwe 6y agoHonestly the doc make it pretty unclear. Some commands seem to be purely github related, which make sense, some others seem to overlap with just plain git. > Clone the repository you want to work with using gh repo clone owner/repo Like, what does this do apart from a regular git clone? Why is this necessary? I guess it additionally stores some meta information so that other "gh" commands know which repo they are on. This should have been a separate command IMHO to leave the regular git clone alone. Something like "git clone ssh://github.com/foo/bar" followed by "gh init foo/bar". > When you’ve finished adding that feature or fixing that bug, use gh pr create Same goes here. Why overlaying git commands? I would have expected to just push my branch, and then call something like "gh pr create <my branch> <target branch>" > And your teammate can check out your pull request using gh pr checkout 1337 Same remark again and again, what does that do apart from checking out a branch? Why the overlay? > view the diff with gh pr diff So what's wrong with "git diff <target>..<source>" > gh pr merge Come on.. "git co <target> ; git merge <source>" needs to be overplayed? > gh release create [tag name] Oh sure, let's overlay git flow as well. I mean overall the tool looks cute and all, but magic overlays is a no no for me.
- pbalau 6y agoConvenience. > Like, what does this do apart from a regular git clone? Why is this necessary? You can't see a difference between ```gh repo clone owner/repo``` and ```git clone git@github.com:owner/repo.git```? Also: > Something like "git clone ssh://github.com/foo/bar" followed by "gh init foo/bar" What's there to "init"? > Same goes here. Why overlaying git commands? I would have expected to just push my branch, and then call something like "gh pr create <my branch> <target branch>" From the docs: "When the current branch isn’t fully pushed to a git remote, a prompt will ask where to push the branch [...]" > Same remark again and again, what does that do apart from checking out a branch? Why the overlay? It resolves the pr # to the corresponding branch name, probably git fetch and checkout. Why should I have to know the irrelevant piece of information that is how you named your branch? > So what's wrong with "git diff <target>..<source>" How do you find out the target and source hashes? Another piece of convenience. > Come on.. "git co <target> ; git merge <source>" needs to be overplayed? And this is wrong. This merges source in target locally, ```gh pr merge``` merges it remotely. You can be Linus Torvalds, you are not going to push to my master branch.
- georgedrummond 6y agoNo doubt the intent of this tool is to tightly couple your development flow to GitHub/Microsoft. Makes switching to other vendors more painful further down the line.
- maccard 6y agoThat's a fairly cynical take. How is this any worse than offering an API? It's open source [0], there's nothing stopping you hooking it up to Gitlab, or pointing it at jira. [0] https://github.com/cli/cli https://github.com/cli/cli
- algorithmsRcool 6y agoI don't understand this mentality. Git itself doesn't provide a way to interact with PRs or issues on GitHub. This utility does. If you are uncomfortable with using GH to manage issues and PRs you shouldn't probably shouldn't be using GH.
- Iwan-Zotow 6y agoHow you could create issue with git? Project on github is much more that just git repo
- ape4 6y agoYeah, I wonder if `git` could be improved based on this.
- shaky 6y agoI don't understand the appeal of using a cli to manage commits, branches, remotes, merges with conflicts, and so on. To me all these things are so much better internalized and understood when presented visually. Git GUIs are aplenty (Sublime Merge being my latest discovery, SourceTree before that) and generally really good. Combined with the already amazing GitHub web GUI, it's a wonder what use case is better served by sticking to the cli, other than this misplaced notion that it's what the cool kids are doing.
- judofyr 6y agoThere are a bunch of examples which I find very useful with the CLI: Creating new repos (gh repo create), opening the repo in the browser (gh repo view), checking out PRs when you have the ID (gh pr checkout ID), diffing the currently checkout PR against the base (gh pr diff).
- aosaigh 6y agoHow about when you already do most of your development on the command line? In web development anyway, most frameworks, servers and tools are CLI only so you are already on the command line for the most part. It's far quicker to do a quick commit there and then rather then move to a GUI. That said, I use both. Most of my commits etc. are on the CLI but I still switch to a GUI if I want to browse the repo or see more detailed diffs etc.
- jacurtis 6y agoExactly this. I use the GitHub CLI and website interchangably throughout the day. When making commit messages, I generally always link a commit to an issue. So the end of a commit message will generally say "Resolves #281" or "Fixes #433" or "See Issue #218" or whatever. I usually need to double check open issues when making these messages and since I am already writing commits on the command line, having a split terminal or tab that can pull up active commits with a single line command and see them in a concise and clean format, it is super helpful and fast. If you are already working in the command line all day long, then it makes perfect sense to have access to GitHub in the command line as well. Another benefit is that most IDEs will have direct terminal access within the IDE, which means you can get relevant GitHub details about your project from within the IDE via the terminal, without needing to leave the IDE. Lastly, the CLI version is far more concise and simple compared to the web version. I am not hating the web version. I still use the web version plenty. But it is just another useful tool in the quiver that has plenty of use cases and simplifies workflow.
- adriancooney 6y agoI love this tool and use it everyday. Thank you Github and contributors.
- kkapelon 6y agoWhat about https://hub.github.com/ https://hub.github.com/ ?
- monkey_slap 6y agoCheck out https://github.com/cli/cli/blob/trunk/docs/gh-vs-hub.md https://github.com/cli/cli/blob/trunk/docs/gh-vs-hub.md FWIW gh is built by some of the same people that built & maintain hub.
- mumblerino 6y agoFor the time being, hub still mostly helps with git operations, in fact it can be used as a git wrapper/replacement since it supports all of git’s commands. gh on the other hand seems to very specifically work on GitHub’s non-git features, like Issues, PRs, repositories.
- RMPR 6y agoIME for non-git features hub is very slow iirc it's written in Ruby
- caycep0llard 6y agohub has been pure Go for a long time now.
- pkamb 6y agoI use `hub sync` multiple times per day. Essential tool. It's the only way to stay sane in a repo with multiple other developers merging PRs. Updates all of your branches in the background to the current remote version.
- mroll 6y agoOh wow this is great. I’ve been wanting an org mode integration with GitHub for a while, and this tool might make it easy enough for me to hack together this weekend. Basically I want to be able to pull up a buffer with a list of issues assigned to me and copy them into my org mode todo list
- DvdMgr 6y agoYou can do this using Forge within Magit already! And it also works for Gitlab: https://magit.vc/manual/forge/ https://magit.vc/manual/forge/
- iterati 6y agoForge is great. Magit is such an enjoyable plugin already, but integration with PRs and issues takes it to the next level.
- RMPR 6y agoNow this is awesome.
- chungus 6y agoBeen meaning to try Forge, thanks for the reminder. Honestly, Magit alone is enough reason to use Emacs. Projectile is a close second for me.
- gumby 6y agoI find projectile too chatty and distracting none thing I like about emacs is that I can focus on what I’m working on.
- narwally 6y agoIn what way do you find it too chatty? That hasn't been my experience, but I do use a pretty small subset of it. Are you using it on its own, or with helm/ivy?
- deleted 6y ago[deleted]
- Shared404 6y agoIs there an advantage to using this over the standard git cli tool? It seems kinda like making a cli tool for a web interface for a tool. I guess I'm just missing something. Edit: Spelling.
- pbalau 6y agoYes, you are missing. This is GitHUB cli, not git cli. This has nothing to do with git.
- Shared404 6y ago> GitHUB cli So a wrapper for an API for a website for git? Why? Edit: Also, how does anything working with GitHub have nothing to do with git? Edit 2: Don't get me wrong, this looks like a cool tool. I'm just curious about the motivation.
- hemanta212 6y agoGithub provides additional functionalities over git for which users had to switch from cli to web. Now they are bringing those additional functionalities to cli so users dont have to switch context
- Shared404 6y agoAh, that makes sense then. Many thanks.
- blntechie 6y agoGood they have the Enterprise server support now. Time to try it now. I had to some hacks to use request-pull with the GitHub's process.
- pickledish 6y agoHmm, anyone know the name of the font they're using in the pictures? Closest I was able to find was anonymous pro, but that's not quite it
- naveguese 6y agoThe monospace font in Apple's San Francisco family, SF Mono. https://github.com/lionsharecapital/lionshare-desktop/tree/master/src/assets/fonts https://github.com/lionsharecapital/lionshare-desktop/tree/m...
- pickledish 6y agoAh yeah, so it is! Good eye :)
- djsumdog 6y agoI've used ghi before just for issues: https://github.com/stephencelis/ghi https://github.com/stephencelis/ghi It's pretty nice. I like seeing these features supported officially (I think hub supported many of these unofficially for years). What tools are there like this for Gitlab? I remember struggling just to find a decent CLI for their issue tracker. All my new stuff is on Gitlab and I prefer Gitlab since if I ever want to, I can always just management my own instance and migrate to it. No such options with Github.
- KarimDaghari 6y agoIf you use VSCode they have a pretty decent extension (GitLab Workflow)
- anderspitman 6y agoExtend
- deleted 6y ago[deleted]
- algorithmsRcool 6y agoGitHub is killing it with these features. I wonder how long Azure Repos will survive on it's own.
- Scarbutt 6y agoAnd Golang is killing it for these kind of applications.
- narwally 6y agoI haven't done much beyond dip my toes in Golang so far, but I did start moving my blog over from Jekyll to Hugo last week; Man do I love just being able to install a single binary and then get to work. Python, Javascript, and Ruby have a lot of nice packages, but I always have to futz around with the language itself to use them effectively. It's probably a bit easier to get a project up and running in a scripting language, but any development time that is saved just gets passed on to the users as we have to install a ton of npm packages or try to fix our gem dependencies.
- rhizome 6y agoAre dependency problems with Hugo modules not possible?
- narwally 6y agoI'm sure there are, but I haven't needed to use any modules so far, so I have no perspective on what kind of challenges they present. But with Jekyll you could get into dependency issues just trying to go through the tutorial and launch a blank template of a site. You didn't need any extra functionality on top of Jekyll to begin to dealing with dependencies.
- maxioatic 6y agoI was wondering if this was written in Go, and specifically using the Cobra framework. I checked out the repo and it was! Other common CLIs written with the same framework: kubectl, hugo, rclone (to name a few) Really is a great option.
- janvdberg 6y agoIs this coming full circle: Git -> GitHub -> GitHub CLI?
- DC-3 6y agoReminds me of React -> React Native -> React Native Web.
- yakubin 6y agoCLI or not, it's centralized/siloed all the same. I'm sticking to Git.
- londons_explore 6y agoIt would be really nice if the other features of github could get into the decentralized model of git... I could imagine issues and PR reviews/comments all being mini-commits to some kind of parallel metadata repo under the hood for example.
- jackac 6y agoThere are some experimental tools for distributed code review and issues. https://github.com/google/git-appraise https://github.com/google/git-appraise https://github.com/dspinellis/git-issue https://github.com/dspinellis/git-issue Would be nice to have something more polished though.
- viraptor 6y agoHave a look at fossil https://fossil-scm.org/home/doc/trunk/www/index.wiki https://fossil-scm.org/home/doc/trunk/www/index.wiki Or maybe git-appraise https://github.com/google/git-appraise https://github.com/google/git-appraise git-bug https://github.com/MichaelMure/git-bug https://github.com/MichaelMure/git-bug And recently discussed here https://radicle.xyz/ https://radicle.xyz/
- pferde 6y agoJust make ForgeFed a reality, and then it won't really matter where the project is hosted. :) https://forgefed.peers.community/ https://forgefed.peers.community/
- clon 6y agoAll of GH improvements have become irrelevant for me since they vanished one of our repos. No notification, no warning, no recourse. Just gonsky. It was just a simple library we wrote to talk to a public IP2Country REST service. Pushed to GitLab, end of.
- duhi88 6y agok. Clearly not that irrelevant if you're in here commenting.
- clon 6y agoShould qualify that. I never said it doesn't sadden me to miss out on cool things. But professionally they are indeed irrelevant.
- amiantos 6y agoI find in situations like these that it's pretty unlikely that the person telling the story really has no idea why something bad happened to them.
- clon 6y agoYou are right. I have a hunch. In the local repo there is a file that was was probably produced by running wget github.com im the repo directory. Unsure what it was meant to achieve, but accidentally pushed, it may have flagged the repo down somehow. Maybe the HTML contained some secret token? Still, the main issue was the process how they handled it. Your build breaks. This is how we found out.
- martinwoodward 6y agoMartin from GitHub here - love to understand what happened if you have the time to point me at more details. DM's open (martinwoodward on twitter and martinwoodward at github.com on email)
- clon 6y ago
- yarrel 6y agoOr git, as it's known.
- sigwinch28 6y agoThis is worth it just for `gh repo create`
- akx 6y agoI'd been using `hub create` for several years now...
- sigwinch28 6y agoI'll admit that the only time I heard of the GitHub CLI was last week when I thought to myself "it's really annoying going to the website every time I just want to push a new repo"
- jrochkind1 6y agoI use the older `hub` for only one command, but it's not that one! Instead, I use it for opening a PR from the command line. Since my work generally consists of making feature branches and PR'ing them, I use `hub pull-request` sometimes multiple times a day. Huge time saver.
- wlonkly 6y agoAh, but now you can `gh pr create` instead! Saves four keystrokes. But by the way, `hub browse` and `hub sync` are handy too.
- jrochkind1 6y agoIt's all the same to me if it works, it's easy to switch the one command I use, I'll probably switch to `gh pr create`, since it appears to be the more maintained package. `hub pull-request` does a few things that annoy me or that seem buggy, maybe I'll compare to `pr`. I never did use `hub` as a "wrapper" for `git`, I've always typed `hub pull-request`. I never liked the wrapper idea. So I approve of `gh` abandoning it.
- chriswalz 6y ago
- forrestthewoods 6y agoEmbrace - complete Extend - in progress Extinguish - todo
- SergeAx 6y agoWatch those hands, we are at the "extend" phase [0]. Then there will be bait-and-switch move, and voila, Github is not working with git client, just with their own shell. [0] https://en.wikipedia.org/wiki/Embrace,_extend,_and_extinguish https://en.wikipedia.org/wiki/Embrace,_extend,_and_extinguis...
- wilg 6y agoHow do you know the difference between being in an EEE scenario versus just being in a scenario where people keep working on their product?
- whatgoodisaroad 6y agoWhen the open components that allow free interoperability with GitHub's competitors are replaced with proprietary components that don't.
- wilg 6y agoDid that happen?
- coliveira 6y agoJust look at history.
- wilg 6y agoDoes that mean it _always_ happens? Or only sometimes?
- coliveira 6y agoAnd in a few iterations they will label git as "legacy".
- mikorym 6y agoI think the simple way of passive resistance is calling it "Microsoft GitHub".
- renewiltord 6y agoVery nicely done. The package installation process for Ubuntu is good. Thank you.
- 0xmohit 6y agoWonder if this would lead to the end of hub <https://hub.github.com https://hub.github.com>.
- BFdes 6y agoI think the creator of Hub works for GitHub, possibly on the CLI IIRC.
- jrochkind1 6y agohub was also a github project. Somewhere there is a blog post or something explaining the relationship of this to hub -- basically, they wanted to start over with new architecture and new thoughts, and a more clear organizational commitment to it (even though hub is at `github/hub`, it is github-owned code). There is no particular plan to phase out hub, but once github CLI covers enough features, I'd expect people to switch over to it.
- staller 6y agoThey do not treat hub as an official github project and rather an unofficial open source project that they don't plan to do away with They have a document where they expand on this: https://github.com/cli/cli/blob/trunk/docs/gh-vs-hub.md https://github.com/cli/cli/blob/trunk/docs/gh-vs-hub.md
- maxioatic 6y agoTo highlight from that doc: "The GitHub CLI team is focused solely on building out the new tool, gh. We aren’t shutting down hub or doing anything to change it. It’s an open source project and will continue to exist as long as it’s maintained and keeps receiving contributions."
- everybodyknows 6y agoFarther along in same doc: "hub is a project whose maintainer also happens to be a GitHub employee. He chooses to maintain hub in his spare time, as many of our employees do with open source projects." My experience at FANMAG has been that "spare time" is the scarcest of all resources.
- clarle 6y agoI tried it today, and it's pretty neat, but without the ability to write comments inline, it's not super useful for any actual pull request reviewing work.
- jordanlewis 6y agoI agree. I wrote a tool that does inline PR commenting on the command line. I hope they add something like this to gh over time. https://github.com/jordanlewis/re https://github.com/jordanlewis/re
- nixpulvis 6y agoname me one feature this has that I didn't have 3 years ago with `hub`?
- croo 6y agoGreat news but my first thought was that it's hard enough for juniors to grasp the difference between git and github. Now they will be even more confused... :]
- VWWHFSfQ 6y agoThat's the point
- gregplaysguitar 6y agoTo be fair, they’re not explicitly saying to alias it as `git` this time. At least with a different name the distinction is clearer
- richajak 6y agoI have never really grokked the concept of git to push or pull, commit or diff the code that I write. Tried to convince myself a few times that is best practise from the industry. I still tgz my source code before I intend to make substantial change. Github for me is simply a repo of open source code that I can inspect before I use someone else library.
- sagarm 6y agoSource control is well worth the learning curve. Git is harder to learn than most, though. I hear Mercurial is easier to learn; maybe give it a try?
- deleted 6y ago[deleted]
- gregplaysguitar 6y agoIsn’t mercurial pretty much dead? I know Bitbucket dropped support for it last year. I’ve also found it no more intuitive than git personally.
- DonCopal 6y agoCan you also browse the code with this? Find a file? Find only within xml files? Copy a link to a specific line? Create gists?
- petepete 6y agoYou can create, edit, list and view gists. You can't copy a link to a specific line (afaik). As you run this tool from your project directory you can browse and search code using your tools of choice. It's an excellent tool even if you just use it to quickly create and view PRs and issues, as I do.
- bfuclusion 6y agoFinally, pull requests from the command line without git arcana.
- Aeolun 6y agoDoes something like this exist for bitbucket too?
- pbalau 6y agoBitBucket has a sane API. But it might be a case for a 3rd party os solution...
- dpritchett 6y agoI’d be surprised if bitbucket’s dev tooling budget was 1/10th of GitHub’s even before the MS acquisition. Working with BB APIs has not been fun at any point in the past 5 years or so :(
- dartharva 6y agoI tried it but couldn't get it to push my commits. Reverted back to GUI Github. I'm a n00b though, might just be because I'm dumb. But when they have actually dumbed down the CLI and spent time and resources to make it so user-friendly, shouldn't they have went thorough with it to make it as intuitive as Github Desktop?