Git Tricks – Git up

I realise that my blog is fast becoming a library of Git Tricks – but nevermind, here’s another one!

There is a brilliant tool called git up – if you aren’t using it and you are using Git, then you should probably look into it! It saves a bunch of time.

It requires python, but most people have a python interpreter lying around. Any issues installing – check out the GitHub page, it has loads of information there.

Crash course

1) Install
$ pip install git-up

2) Use in Git directory
$ git up

What does it do?

    1. Stashes any changes
    2. Returns to master branch (if applicable)
    3. Fetches origin
    4. Fast forwards all the branches (if it can!)
    5. Returns to branch which it was called from (if applicable)
    6. Unstashes changes

It gives outputs much like:

$ git up
Fetching origin
branch1          error: remote branch doesn't exist
branch2          up to date
branch3          error: remote branch doesn't exist
branch4          error: remote branch doesn't exist
master           fast-forwarding...

See those error: remote branch doesn't exist? – Clean them up super quickly with one command!

You may also like...

1 Response

  1. June 5, 2015

    […] shows you loads of dead branches you will never use again. Like LOADS. If you are using a cool feature like git up then everytime it runs you end up with a huge list of […]

Leave a Reply

Your email address will not be published.