| name | git-git-bash-prompt |
| description | Git in Bash prompt. TIL note about git. Use when working with git and the user mentions git bash prompt or related topics. |
Git in Bash prompt
How to see git repository status in your bash prompt (see the .sh file for zsh instructions)
Save git-prompt.sh in ~/.bash/
Add to .bashrc:
source ~/.bash/git-prompt.sh
export GIT_PS1_SHOWCOLORHINTS=true
export PROMPT_COMMAND='__git_ps1 "\u@\h \W" "\\\$ "'
export GIT_PS1_SHOWDIRTYSTATE="Y"
export GIT_PS1_SHOWSTASHSTATE="Y"
export GIT_PS1_SHOWUNTRACKEDFILES="Y"