Playing with your bash prompt can seem like nothing more than an idle diversion. It is an idle diversion, it is just the “nothing more” bit that I would argue with. In a previous post I discussed how the bash prompt can reflect what git branch you are on. Now that’s useful. Seriously. But what about the “dirty state” of the branch—whether or not there is any uncommitted changes. I have gotten into the habit of running git status before I do anything in large part to check the dirty status of the branch. Couldn’t this reflex be automated? And reflected in the bash prompt? Yes, yes it can. Inspired by this post and this, I decided to update my bash prompt once again.
Here is a screenshot illustrating the clean and then dirty state of the development branch.
Post a Comment