Last active
April 4, 2019 13:08
-
-
Save kessejones/513f2d9f370fcc7974c35beddb38130e to your computer and use it in GitHub Desktop.
Display git branch name on terminal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#... | |
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
} | |
PS1="${debian_chroot:+($debian_chroot)}\[\e[1m\]\[\e[01;32m\]\u@\h\[\e[00m\]:\[\e[01;34m\]\w\[\e[00m\]\[\e[33m\]\$(parse_git_branch)\[\e[00m\]$ " | |
#... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment