2 ms·
Branches The Bad Habit: “Oops was I on main for that?” I found somewhere on the Net one day a few years back, a small bash addition that includes the git branc
by simonblack 4y ago
Branches
The Bad Habit: “Oops was I on main for that?”
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:
centrepoint [jvs] /home/jvs/wrk/njvtax [master*] >
^ ^ ^
[this part is the commandline prompt] < git > [final part]
[ with HOSTNAME, USERNAME, CWD ] <branch> [ of prompt]
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:
centrepoint [jvs] /home/jvs/hhnse >