Last active
May 31, 2018 10:41
-
-
Save goedel-gang/076c529bf7da8e0acd48a4120c23278d to your computer and use it in GitHub Desktop.
Bash git 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
# this is where it is on my system. Find a copy at | |
# https://github.com/git/git/blob/master/contrib/completion/git-prompt.sh | |
source /usr/share/git/git-prompt.sh | |
# show if there are staged/unstaged changes | |
GIT_PS1_SHOWDIRTYSTATE=true | |
# pretty colours | |
GIT_PS1_SHOWCOLORHINTS=true | |
# show if there are untracked files | |
GIT_PS1_SHOWUNTRACKEDFILES=true | |
# sets prompt command. the two arguments are the string to appear before the git | |
# status, and the string to appear after it, using normal Bash prompt syntax. | |
PROMPT_COMMAND='__git_ps1 "\u|$(basename $(dirname "$PWD"))/$(basename "$PWD")" " "' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment