Skip to content

Instantly share code, notes, and snippets.

@sigilioso
Last active April 19, 2018 07:17
Show Gist options
  • Save sigilioso/4171643 to your computer and use it in GitHub Desktop.
Save sigilioso/4171643 to your computer and use it in GitHub Desktop.
Custom prompt including git information
export LANGUAGE==en_US.utf8
export JAVA_HOME=/usr/lib/jvm/java-8-oracle
# https://github.com/git/git/blob/master/contrib/completion/git-completion.bash
source ~/.utils/git-completion.bash
# Only if docker installed
source /etc/bash_completion.d/docker
case "$TERM" in
xterm*) TERM=xterm-256color
esac
function git_dirty_state() {
if [ $(__gitdir) ]; then
[[ -n "$(git status --porcelain 2> /dev/null)" ]] && echo "✘" || echo "✔"
fi
}
PS1='\[\033[00;35m\][\[\033[00m\]\[\033[00;33m\]\u@\h:\[\033[00m\]\[\033[01;34m\]\w\[\033[00m\]\[\033[00;36m\]$(__git_ps1 "(%s)")$(git_dirty_state)\[\033[00m\]\[\033[00;35m\]]\[\033[00m\]\n\$ '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment