Hub: Use GitHub from the Command Line
hub.github.com
hub.github.com
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.
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.
If you are not familar with Magit, there is a screencast: Emacs Rocks! Episode 17: Magit https://www.youtube.com/watch?v=rzQEIRRJ2T0
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.
hub pr checkout 1234 git fetch origin pull/⟨PR id⟩/head:pr-⟨PR id⟩ && git checkout pr-⟨PR id⟩
(but hub is nicer of course) [alias]
pr = !"pr() { git fetch origin pull/$1/head:pr-$1; }; pr"
And then do `git pr 1234 ; git checkout pr-1234`. Feel free to add `git checkout` to the alias if you prefer.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.
Linuxbrew can[1]:
* Install software to your home directory and so does not require sudo.
* Install software not packaged by your host distribution.
* Install up-to-date versions of software when your host distribution is old.
I do this in order for the merge commit to be signed.
[alias]
pr = !"pr() { git fetch origin pull/$1/head:pr-$1; }; pr"
[1]: https://news.ycombinator.com/item?id=20374136So what does it do that git doesn't? Without answering that, it feels awkward to put forward a CLI frontend to a CLI tool.
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.
That ship has sailed. This tool has existed (and been popular) for years.