I recently decided to see if I could create my own bash prompt, inspired by a short guide on making it like powerline. I did want to customize the prompt, but not for it to have the powerline look, so I decided to dig further. Here’s the result.
Thanks to the aforementioned short guide, I found out that in the git repository there is a file that enables git prompt support in bash and zsh. The comments in the beginning of the file give setup and usage instructions and configurable parameters. I’ve set it up to show dirty state, untracked files and if there are differences between the repo and upstream.
# custom prompt
source $HOME/.git-prompt.sh
export GIT_PS1_SHOWDIRTYSTATE="True"
export GIT_PS1_SHOWUNTRACKEDFILES="True"