Skip to content

Instantly share code, notes, and snippets.

@TylerJWhit
TylerJWhit / .bashrc
Last active March 12, 2020 02:14 — forked from chrisnolet/.bash_profile
Color-coded git branch for bash prompt
# Original Source https://gist.github.com/chrisnolet/46206e21d59f8250bb979a8516a9a034
# Modified to stick with Pop_OS! Style.
parse_git_branch() {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* (*\([^)]*\))*/\1/'
}
markup_git_branch() {
if [[ -n $@ ]]; then
if [[ -z $(git status --porcelain 2> /dev/null) ]]; then
@TylerJWhit
TylerJWhit / .bash_profile
Created March 1, 2020 07:57 — forked from chrisnolet/.bash_profile
Color-coded git branch for bash prompt
parse_git_branch() {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* (*\([^)]*\))*/\1/'
}
markup_git_branch() {
if [[ -n $@ ]]; then
if [[ -z $(git status --porcelain 2> /dev/null) ]]; then
echo -e " \001\033[32m\002($@)\001\033[0m\002"
else
echo -e " \001\033[31m\002($@)\001\033[0m\002"