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.
$ 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...
error: remote branch doesn't exist? – Clean them up super quickly with one command!