Skip to content

Instantly share code, notes, and snippets.

@alicanerdogan
Created September 6, 2016 19:54
Show Gist options
  • Save alicanerdogan/827d574b4a150e2b5e24d7b104aa1dac to your computer and use it in GitHub Desktop.
Save alicanerdogan/827d574b4a150e2b5e24d7b104aa1dac to your computer and use it in GitHub Desktop.
Default bashrc with git branch
# Preview:
# ae > /mnt/c/Users/Alican/Repos/aTorrent (master)
# $
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
export PS1="\[$(tput bold)\]\[\033[38;5;230m\]\u\[$(tput sgr0)\]\[$(tput sgr0)\]\[\033[38;5;15m\] \[$(tput bold)\]>\[$(tput sgr0)\] \[$(tput sgr0)\]\[\033[38;5;14m\]\w\[$(tput sgr0)\]\[\033[38;5;15m\] \[\033[38;5;11m\]\$(parse_git_branch)\n\[$(tput bold)\]\[$(tput sgr0)\]\[\033[38;5;230m\]\\$\[$(tput sgr0)\]\[$(tput sgr0)\]\[\033[38;5;15m\] \[$(tput sgr0)\]"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment