Kinja Technology
Kinja Technology

When we started using Git back in 2011 at Gawker, I was all about using a Git client application. We found pretty quickly and started using it, but I somehow found myself always returning to the command line, except for staging small chunks of files as is much better in that than "git add -p". I also started writing small scripts for recurring operations like pull-with-rebase and pull-with-rebase-and-then-push, and then I found a Git prompt and I felt like I have arrived. A Git prompt is nothing special if you are on a regular directory in your filesystem, but it will add some useful info about a repository's state in case you are in one. So here is my take on it.

Illustration for article titled A Git prompt Im using

First it will tell you which branch are you on, then you'll see how many stashes you have, and then how many of your files are new, changed or staged for commit. Finally, it tells you how many commits are there waiting to be pushed. That's it, basically, but the main line is that it is pretty fast: works well with hundreds of files changed too. You can find it in my dotfiles repo forked from Zach Holman's in case you are interested.

Share This Story

Get our newsletter