Skip to content

Instantly share code, notes, and snippets.

@atsukoba
Created June 28, 2019 21:42
Show Gist options
  • Save atsukoba/369f8afa9bde30ceafce2d4f3b087a2c to your computer and use it in GitHub Desktop.
Save atsukoba/369f8afa9bde30ceafce2d4f3b087a2c to your computer and use it in GitHub Desktop.
Git Branch Extention for bash prompt
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ [\1]/'
}
export PS1="\n\[\e[0;37m\][\#(\!)] \[\e[0;33m\]\t \[\e[0;34m\]\u \[\e[0;37m\]at \[\e[0;31m\]\w\[\e[0;37m\]\[\e[1;37m\]\$(parse_git_branch)\[\e[1;37m\]\n\[\e[0;36m\]--> \[\e[0m\]"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment