Last active
November 22, 2020 11:35
-
-
Save MauricioRobayo/92eadc7dd94ee5dee29038306cc2882e to your computer and use it in GitHub Desktop.
Git PS1 using git-prompt.sh
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
# https://github.com/git/git/blob/master/contrib/completion/git-prompt.sh | |
[ -s "$HOME/.git-prompt.sh" ] && . "$HOME/.git-prompt.sh" | |
[ -s "$HOME/.git-completion.bash" ] && . "$HOME/.git-completion.bash" | |
GIT_PS1_SHOWDIRTYSTATE=1 | |
GIT_PS1_SHOWSTASHSTATE=1 | |
GIT_PS1_SHOWUNTRACKEDFILES=1 | |
GIT_PS1_SHOWCOLORHINTS=1 | |
GIT_PS1_SHOWUPSTREAM="auto" | |
GIT_PS1_DESCRIBE_STYLE="default" | |
exitstatus() { | |
[ $? -ne 0 ] && echo -e "\e[1;31mE!\e[0m" | |
} | |
ps1_pre+='$(exitstatus)[\W]' | |
ps1_post='\$ ' | |
PROMPT_COMMAND="__git_ps1 '${ps1_pre}' '${ps1_post}' '(%s)'" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment