@RyanStewart recently tweeted about using git on the command line. Ryan refers to a post by Railsdog, which offers a nice solution to see on which branch you are working in a given folder ( which contains a git repo ).
I took this approach one step further and added some nice colored icons that represent the status of the current git repo:
This sort of functionality already exists of course, but I took this opportunity to learn more about shell scripting. So don’t use my solution as the best one out there, it is merely the result of me reading up on shell scripting. First make a copy of your ~/.bash_profile file. Paste ( and/or append ) the contents of this gist ( as seen below ) in your ~/.bash_profile ( create one if it doesn’t exist yet ), and open a new Terminal window to see the changes. Make sure you are in a folder that contains a git repo to actually see the branch name and colorful checkmark / x icons.