Some Git sugar for your .bashrc

I’m one of those people that use Git command line quite a lot and have not really adopted any Git GUI clients. To make make life in the terminal more efficient I have added some sugar to my .bashrc.

Make “g” an alias for “git”

The first line creates the alias “g” for “git”. Sadly tab completion stops working and the second line takes care of readding that. At the time of writing I’m running Git versionĀ 2.11.0 on OSX installed via Brew.

Branch Shortcuts

Jumping between branches is so common I’ve added aliases that even allow me to omit the initial “g”. The functions “bs” and “bl” stands for “branch save” and “branch load” and allow me to save a certain branch name that I can later on jump back to.

Gitty Git Aliases

Of course you should throw in some regular “git git aliases” as well.

Bulk Actions on Many Repositories

Behold mein bulk action tool! Assume you wanted to git add everything in all repositories placed within the directory you are currently standing. This is how you would do it:

And the beauty of it is that the work is done asynchronously.

By |2017-10-12T10:15:33+00:00October 12th, 2017|Uncategorized|0 Comments

Leave A Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.