Created
August 22, 2014 22:21
-
-
Save p120ph37/15efac098fcf98d9da08 to your computer and use it in GitHub Desktop.
Git Bash Prompt
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
# produce a colorized path string with the git branch injected at the root of the repository | |
PS1git='\[\e[94m\]$(git rev-parse --show-toplevel 2>/dev/null)$( \ | |
( test -z "$(git status -s 2>/dev/null)" && __git_ps1 "\[\e[32m\](%s)" ) \ | |
|| __git_ps1 "\[\e[91m\]{%s}" \ | |
)\[\e[94m\]${PWD##$(git rev-parse --show-toplevel 2>/dev/null)}' | |
# Use where you would use "\w" in your PS1 prompt. e.g.: | |
PS1='${debian_chroot:+($debian_chroot)}\[\e[1;32m\]\u@\h\[\e[0m\]:'"$PS1git"'\[\e[0m\]\$' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Looks something like this, but in color: