
Hub: Use GitHub from the Command Line - maxfan8
https://hub.github.com/
======
inlineint
While it is pretty cool, using such tool increases general lock-in to GitHub,
in terms of both habits and potential use of it for automation of processes.

I wish there was an open standard for operations that hub allows to do and all
major Git forges [1], including open source ones, such as Gogs/Gitea and
GitLab, supported it. In that case having a command-line tool that, like Git
itself, is not tied to a particular vendor, but allows to do what hub does,
could have been indispensable.

[1]
[https://en.wikipedia.org/wiki/Forge_(software)](https://en.wikipedia.org/wiki/Forge_\(software\))

~~~
lugg
Git remotes _is_ the standard.

Hub is pretty much a glorified ref transformer.

You can do a lot of what it does with plain old aliases and really should if
you work with multiple forges.

You're also only talking about a single git use case which not everyone
follows, even within a single forge.

Something tackling the problem from the other end is phabricator which
integrates each VCS into the same forge platform. Well, mostly (badly), it's
kind of a total mess with specific things you need to work around for each.

I can see the same thing happening to anything trying it from the forge end.

Just because gitlab has pull requests does not mean that GitHub born idea is
the best or will even stay.

How would you marry up Gerrit to GitHub (you can't).

What you're asking for only really works for something following gitflow,
which would be kind of stupid to base a standard on because it's broken by
design and doesn't scale. But you would have to because otherwise GitHub won't
use it.

------
fcarraldo
Hub is essential for anyone who works with GitHub repositories, IMO.

It gives you, if nothing else, an important shortcut: `hub checkout
github.com/repo/pulls/1234` automatically adds a remote, fetches, and checks
out the branch of a given pull request. Great for local testing/validation,
when needed.

~~~
cco
I might be missing something, but can’t you just `git checkout -b <feature-
branch-name>`?

~~~
fcarraldo
Not if the branch is on a fork.

~~~
cco
Ah gotcha, then that is a pretty handy shortcut.

------
lisnake
Slightly tangential: I keep seeing Linuxbrew references on various tool
installation instructions. Is Linuxbrew really gaining popularity? Why would
you use it instead of your distro package management?

~~~
izolate
Admittedly a Mac-to-Linux convert here, but what I like about linux/homebrew
is the ability to build the very latest version of the requested package on
the day of the release. Distro package managers make living on the bleeding
edge more difficult.

~~~
correct_horse
I use Arch Linux, whose motto could be "living on the bleeding edge" (maybe
combined with "annoying install process"). This even with the included package
manager. But with Debian derivatives, you can add Debian testing to your apt
configuration to get newer packages.

Aside: I think "old" packages (~1year) actually protect you from a few bugs
and make some sense on servers, but I wouldn't hesitate to use Debian testing
on a desktop.

------
shocked-pikachu
I wrote something like this called git-admin[1] for remotely managing
repositories and the like.

[1] [https://github.com/ninetynine/git-
admin](https://github.com/ninetynine/git-admin)

------
foreigner
I use Hub every day! The only command I use is "hub pull-request" though.

~~~
fphilipe
Me too, plus `hub merge $PR_URL` in order to merge PRs locally with the same
commit message as if I had pressed the "Merge Pull Request" button on GitHub.

I do this in order for the merge commit to be signed.

------
stockkid
Hub is pretty cool. I've used it to automate the release process on github by
writing a simple bash script.

------
asragab
Does anyone know if it is possible, using hub, to sync a personal fork, with
its upstream?

------
Topgamer7
I use hub, but almost exclusively to clone a repo, or more frequently, create
a pull request (being able to specify a base branch to)

~~~
pizzazzaro
Uhm... Why not just use git for that?

~~~
Topgamer7
Less typing.

------
dijit
Anything existing that does similar for gitlab?

~~~
xvilka
[https://github.com/zaquestion/lab](https://github.com/zaquestion/lab)

~~~
pizzazzaro
Anyone see the irony that its for gitlab, but posted on github?

So what does it do that git doesn't? Without answering that, it feels awkward
to put forward a CLI frontend to a CLI tool.

------
fit2rule
Awesome. I've needed something like this since the beginning of github.com
itself. I can now, with glee and joy, chuck all the lame curl scripts I was
using/maintaining to try to perform the same function, and use something
better.

The only thing is, I don't like the name. The use of the term 'hub' is a bit
dangerous - I know other tools out there named such. For me, it'd have been
better to have named it something more specific/unique to the intended
purpose, like 'ghub' or even better, 'github-client', and then leave the
alias-to-simpler-word up to the end user.

~~~
latexr
> The only thing is, I don't like the name.

That ship has sailed. This tool has existed (and been popular) for years.

~~~
fit2rule
Fair enough, didn't know that, thanks for the info ..

