
Hub: Wraps Git with extra features that make working with GitHub easier - loppers92
https://github.com/github/hub
======
geerlingguy
I've used hub for a few years, but I find the advice of replacing the 'git'
command with 'hub' to be a bit over the top. Security/compatibility concerns
aside, it can easily confuse non-experts as to what kind of CLI functionality
git itself (vs hub/github) provides.

It's often helpful to know what's actually happening... then add something
like hub later as an optimization.

~~~
timvdalen
I had git replaced with hub a few years back but hub was just way too slow
starting up, killing what seemed like git performance.

~~~
johnny22
that's a huge reason why they rewrote it in Go

------
codefined
This doesn't seem to give me a single clue on what it does past the initial
change of:

    
    
        hub clone rtomayko/tilt
    

Am I missing something?

~~~
Gaelan

        hub pull-request
        hub fork # adds remote automatically
        hub create # create GH repo for this local repo
    

And ability to use GH paths anywhere git takes a URL - clone (as you
mentioned), remote add, submodules, etc.

~~~
alkonaut
That should be on the front page. Above the fold.

~~~
zimmund
A good thing about this (being an open source project) is that anyone can fix
it and create a PR :D

------
jepler
Personally I'd rather see my github integration as a subcommand: 'git hub
clone foo/bar', etc.

~~~
stock_toaster
Should be easy enough to add an alias to $HOME/.gitconfig right?

    
    
      [alias]
      hub = !hub

~~~
gtklocker
Very nice!

------
lobster_johnson
Very nice tool, I use it a lot. But I wish they would do releases more often.
The last stable release was October 2016, and it's been actively developed
since then.

For example, the "release" command (which is great for using from a Makefile
to do an automated release) has lots of functionality on master, but the
current release only supports making new releases.

~~~
voltagex_
[https://github.com/github/hub/releases](https://github.com/github/hub/releases)
shows some pre releases. I suspect they'd be stable enough.

~~~
lobster_johnson
They're still old. Newest prerelease is from February.

~~~
voltagex_
Ah, right.

I may fork hub tonight and let Travis build a newer version.

------
techman9
Pretty essential if you're working on a project hosted on Github. I primarily
use it to make PR's from the command line, but that alone is a huge win.

~~~
pawadu
Maybe its just me, but I would rather have PR functionality in git itself.

Linus, please make it happen :)

~~~
Sharlin
How would that work? Besides starting completely new centralized git service
to compete with github and co? Anyway, git already has a "pull request" system
in the form of git send-email and related commands.

~~~
abritinthebay
I know Linus probably would not agree but emails aren't a substitute for a
pull request system: they're a bandaid to compensate for the lack of one.

I agree it would require additions to git & some kinda of standard around it
but it's telling that every major git system in use "solves" this problem.

------
dwrench07
Is this similar or how is different/better than gitflow?
[http://nvie.com/posts/a-successful-git-branching-
model/](http://nvie.com/posts/a-successful-git-branching-model/)

~~~
lauritzsh
gitflow is comparing OOP and FP. If git is C then hub is C++. I don't believe
you can compare the two. hub just adds some convenient commands to git for
working with GitHub.

------
dmacedo
I have used this extensively for interacting with Github.

But definitely, my biggest use is for quickly creating new private repos in
Github to save small experiments (doesn't require hub to be aliased to git):

    
    
        new => !git init && git commit --allow-empty -m 'Initial commit (empty)' && hub create -p `basename $PWD`
    

For new projects (hope you can get the aliases):

    
    
        mkdir newproject && cd newproject
        g new
        # Do stuff, etc...
        gcia -m "Add project start" && gp

------
lgierth
I've been using hub to do update orchestration over a group of repos, i.e.
bubbling up updates through a dependency tree, opening respective Pull
Requests, linking them among each other, etc.

------
tnorthcutt
Previously:
[https://news.ycombinator.com/item?id=9616239](https://news.ycombinator.com/item?id=9616239)

------
mbrookes
It doesn't compare with hub, but I wrote gpr to make dealing with pull-
requests easier as a maintainer. The main use case to check out a PR on a
detached head:

 _gpr <PR#>_

You can also easily checkout a branch from another users fork.

[https://github.com/mbrookes/git-pull-
request](https://github.com/mbrookes/git-pull-request)

------
omarforgotpwd
I use this as my default git command via aliasing, as mentioned in the ReadMe.
Paste this in your bash profile to alias: eval "$(hub alias -s)"

~~~
voltagex_
Note that this does shell detection and works for most common shells, but your
eval may be different.

[https://github.com/github/hub/blob/master/commands/alias.go#...](https://github.com/github/hub/blob/master/commands/alias.go#L55)

------
jonSson99
does this help you move around Zenhub issues on your kanban from commit -m "?"

------
weq
but isnt git pretty much the best thing in the world since it was made by the
who who remote linux? Why do u need sugar ontop of it?

Oh wait, thats right, cause guys who make operating systems dont make human
software.

~~~
voltagex_
I know I shouldn't reply to comments like this, but what are _you_ going to do
to make the (software) world better? Git's got warts but it's getting better,
and there are alternatives like Mercurial if they work better for you.

~~~
weq
A comment that states the obvious? Im merely pointing out the power of the OSS
hype-machine.

Like it would make sense to me if everyone who used git also used VIM, but
they dont. Its a testiment to the power of the flock, that a product which
gets its core functionaly so wrong, be used by so many ppl.

as for the topic at hand, if my company had invested so heavily into such a
product, i would be doing everything in power to make it work. let alone if my
companies core business was all in on it like github, it would be a no brainer
and i cant beelive its taken so long to get the top of the backlog. looking
forward to the nxt installment of hub which introduces propriority commands
and see if they get treated like MS does :)

~~~
voltagex_
It's all about the ROI for GitHub - git works well enough for them.

If a problem in Git was causing a problem for GitHub I'm sure they'd work to
fix it. Although I don't see any @github addresses in git's git.

~~~
_ikke_
There certainly are github employees who contribute a lot to git, but not with
their github e-mail address, but with their personal address.

