Git Branch in the Bash Prompt

Posted on The Distress Signal | tooling

Waaaay late on this one—but you know what they say. For a while I’ve had a text trigger in iTerm2 to catch and highlight the currently active Git branch—but it never occurred to me to just add it directly into the command prompt.

command-prompt

Trivial to do, and super helpful—as soon as you open up the directory, you immediately know what branch you’re working in. Here is the setup for the prompt looks like, just drop that into your .bash_profile and you’re all set.