
GitHub CLI 1.0 - todsacerdoti
https://github.blog/2020-09-17-github-cli-1-0-is-now-available/
======
mroll
Oh 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
You can do this using Forge within Magit already! And it also works for
Gitlab: [https://magit.vc/manual/forge/](https://magit.vc/manual/forge/)

~~~
chungus
Been 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
I find projectile too chatty and distracting none thing I like about emacs is
that I can focus on what I’m working on.

~~~
narwally
In 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?

~~~
gumby
It could have been hel or ivy I was seeing. I don’t like the mode line moving
(growing the minibuffer) as I typically keep my eyes on part of the buffer and
don’t want anything moving (or worse, obscuring where I’m looking)

------
algorithmsRcool
GitHub is killing it with these features. I wonder how long Azure Repos will
survive on it's own.

~~~
boogies
Never heard of Azure Repos before. Do they have any unique features that could
be merged into Github?

~~~
DavidKarlas
When reviewing PR, it has nice file/folder tree on left side, which is far
superior compared to scrolling over 10+ files without context on Github, I
hope Github gets this soon...

~~~
bbatha
There's a browser plugin called Octotree which does a pretty good job of this,
but I'd prefer it to be builtin.

------
croo
Great 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...
:]

~~~
gregplaysguitar
To 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
I 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
Source 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?

~~~
gregplaysguitar
Isn’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.

------
kkapelon
What about [https://hub.github.com/](https://hub.github.com/) ?

~~~
monkey_slap
Check 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.

~~~
kkapelon
Thanks. I think this info should become part of the blog post IMHO

------
djsumdog
I'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
If you use VSCode they have a pretty decent extension (GitLab Workflow)

------
sigwinch28
This is worth it just for `gh repo create`

~~~
akx
I'd been using `hub create` for several years now...

~~~
sigwinch28
I'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
I 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
Ah, but now you can `gh pr create` instead! Saves four keystrokes.

But by the way, `hub browse` and `hub sync` are handy too.

~~~
jrochkind1
It'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.

------
shaky
I 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.

~~~
jkubicek
It's worth installing the CLI just for a single command:

`gh pr create --web`

Saves me having to push my current branch, navigate to the repo page, hit the
"create PR" button, etc.

~~~
bewuethr
This is one of my favourites, too! And combined with the alias functionality,
you can do

    
    
        gh alias set pcw 'pr create --web'
    

and then just use

    
    
        gh pcw
    

to create a new PR. There's also sufficient smarts around forking or not,
depending on write permissions on the upstream repo.

~~~
jhatemyjob
Do you run this command frequently enough to do an alias? I feel like it'd be
better to just have the muscle memory of typing the actual command instead

~~~
bewuethr
Probably a few times a day? One nice thing about the alias is that it expands
and takes more parameters if you want, like

    
    
        gh pcw --base=development
    

It's also super quick to set up an alias, so I don't see why not.

~~~
jhatemyjob
I used to have a lot of git aliases but then I became dependent on those and
forgot the actual git commands that were lying underneath. So whenever I went
to a new system I'd have to port my dotfiles or look up the git docs for what
the commands were. If a colleague asked me "how do I do X" I had no clue and
had to look in my bashrc. Nowadays I only add them if I do it many many times
per day. Like "git commit -a -m" for example. I try to keep things as close to
stock as I can

This type of alias seems on the fence for me, if was like 10x a day I'd
definitely be on board but a few times a day is a gray area

------
janvdberg
Is this coming full circle: Git -> GitHub -> GitHub CLI?

~~~
yakubin
CLI or not, it's centralized/siloed all the same. I'm sticking to Git.

~~~
londons_explore
It 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.

~~~
viraptor
Have 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/)

------
0xmohit
Wonder if this would lead to the end of hub
<[https://hub.github.com](https://hub.github.com)>.

~~~
staller
They 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
To 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
Farther 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.

------
Shared404
Is 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
Yes, you are missing. This is GitHUB cli, not git cli. This has __nothing __to
do with git.

~~~
Shared404
> 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
Github 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
Ah, that makes sense then. Many thanks.

------
SergeAx
Watch 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_extinguis...](https://en.wikipedia.org/wiki/Embrace,_extend,_and_extinguish)

~~~
chadly
This is a tired take. Can a company not legitimately improve their
product/offering without this being accused at them?

If you are referring to GH being owned by MS now, it's 2020 for godsake. Can
we move on from our fathers' trauma? MS has been damn good lately in support
of developers and developer tools.

~~~
Klonoar
I get just as tired of reading this take as the next person, but I don't
necessarily think we should do away with it - it'd be akin to ignoring
history.

I personally remain very uncomfortable with how massive GitHub has become and
how ~99% of software development happens on the platform.

~~~
londons_explore
There isn't much lock-in yet though. If you wanted to move a project from
github to gitlab, you could move the code over with a few commands. Open
issues and stuff could be moved over with a script. There isn't much 'network
effect' that means your project would die on other hosting.

~~~
Klonoar
This is classic "it could be built in a weekend" syndrome, and I think we're
all intelligent enough on this site to know that it's simply not true.

Furthermore, technology isn't the lock-in - it's the network, which you can't
drag as easily.

------
pickledish
Hmm, 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
The monospace font in Apple's San Francisco family, SF Mono.

[https://github.com/lionsharecapital/lionshare-
desktop/tree/m...](https://github.com/lionsharecapital/lionshare-
desktop/tree/master/src/assets/fonts)

~~~
pickledish
Ah yeah, so it is! Good eye :)

------
dartharva
I 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?

------
Aeolun
Does something like this exist for bitbucket too?

~~~
dpritchett
I’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
:(

------
clon
All 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.

~~~
martinwoodward
Martin 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)

~~~
sigwinch28
This is part of the problem.

No recourse for such decisions unless you make a stink about it on an orange
website or get enough likes on the website with the blue bird logo.

~~~
bananabreakfast
Probably wasn't a decision. And if it was, I'm sure it's much more complicated
than OP is letting on.

~~~
sigwinch28
Even an automated decision is a decision, because someone decided that's how
the system should operate. Perhaps it was a bug?

Furthermore, no: GitHub has a history of being bad at this kind of thing:

[https://news.ycombinator.com/item?id=22593595](https://news.ycombinator.com/item?id=22593595)

From the linked article: "A week after I’ve opened the support ticket, GitHub
has finally replied. Suspiciously, this happened right after someone important
has posted a link to this article on Hacker News"

[https://news.ycombinator.com/item?id=22628961](https://news.ycombinator.com/item?id=22628961)

Top comment: GitHub CEO coming in and apologising. From the linked tweet: "You
sited US trade sanctions and sent me a non-descriptive email with no
remediation information".

------
adriancooney
I love this tool and use it everyday. Thank you Github and contributors.

------
clarle
I 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
I 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)

------
blntechie
Good 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.

------
DonCopal
Can 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
You 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.

------
nixpulvis
name me one feature this has that I didn't have 3 years ago with `hub`?

------
renewiltord
Very nicely done. The package installation process for Ubuntu is good. Thank
you.

------
bfuclusion
Finally, pull requests from the command line without git arcana.

------
forrestthewoods
Embrace - complete

Extend - in progress

Extinguish - todo

------
anderspitman
Extend

------
yarrel
Or git, as it's known.

------
dberg
Is 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.

~~~
georgedrummond
No 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.

~~~
algorithmsRcool
I 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.

