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?
- Stashes any changes
- Returns to master branch (if applicable)
- Fetches origin
- Fast forwards all the branches (if it can!)
- Returns to branch which it was called from (if applicable)
- 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!
1 Response
[…] 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 […]