<i>Branches</i>
<i>The Bad Habit: “Oops was I on main for that?”</i><p>I found somewhere on the Net one day a few years back, a small bash addition that includes the git branch on the command-line prompt if the directory happens to be part of a git repository. Thus:<p><pre><code> centrepoint [jvs] /home/jvs/wrk/njvtax [master*] >
^ ^ ^
[this part is the commandline prompt] < git > [final part]
[ with HOSTNAME, USERNAME, CWD ] <branch> [ of prompt]
</code></pre>
The git branch is colored red (or your favorite color). The rest of my prompt is black-on-white, so the git branch really stands out to me. Directories that aren't in a git repository will obviously never show any git branch-name, as in:<p><pre><code> centrepoint [jvs] /home/jvs/hhnse ></code></pre>