Continued quest for the perfect git bash prompt.

On the heels of my responsive bash prompt, I've made another few moves to bring more utility to my git bash prompt.

Dirty?

Yes, so we have our git branch showing in our bash prompt as most do these days. That's a really helpful piece of information to be readily available, but lets do more.

I wanted the name of my branch to also let me know if my working directory is clean or not. If I have uncommitted changes or untracked files, I want to be able to know that just by looking at my bash prompt. So I've now made it so the branch name is red when the working tree is dirty and green when it's clean.

Here's how.

Out of Sync?

How many times have you committed changes and forgotten to push them? Or been working away on a feature and didn't notice you were behind by a number of commits? Wouldn't it be nice to also know if you're ahead or behind the remote tracking branch at a glance?

Here's what I've got

Here's how I did it

All of these tweaks and modifications are tracked in my dotfiles repository so take a look.

Jonathan D. Johnson

I love my wife, my sons, and my work.
Senior Software Engineer @ Codeship.
Ruby/JavaScript. I like to be outside.