Skip to content

Instantly share code, notes, and snippets.

@regisbsb
Last active July 26, 2020 13:18
Show Gist options
  • Save regisbsb/245496649a710e3756263fa27997849e to your computer and use it in GitHub Desktop.
Save regisbsb/245496649a710e3756263fa27997849e to your computer and use it in GitHub Desktop.
Get the branch name in the git bash
# Load in the git branch prompt script.
source ~/.git-prompt.sh
source ~/.profile
PS1="\[\033[38;5;251m\]\u\[$(tput sgr0)\]\[\033[38;5;15m\]@\[$(tput sgr0)\]\[\033[38;5;251m\]\H\[$(tput sgr0)\]\[\033[38;5;15m\]:\[$(tput bold)\]\[$(tput sgr0)\]\[\033[38;5;28m\]\w\[$(tput sgr0)\]\[$(tput sgr0)\]\[\033[38;5;15m\]\n\[$(tput bold)\]\[$(tput sgr0)\]\[\033[38;5;1m\]\\$\[$(tput sgr0)\]\[$(tput sgr0)\]\[\033[38;5;15m\] \[$(tput sgr0)\]"
PS1=$PS1'$(__git_ps1 "(%s) ")'
@regisbsb
Copy link
Author

regisbsb commented Jul 26, 2020

PS1="\[\033[38;5;251m\]\u\[$(tput sgr0)\]\[\033[38;5;15m\]@\[$(tput sgr0)\]\[\033[38;5;251m\]\H\[$(tput sgr0)\]\[\033[38;5;15m\]:\[$(tput bold)\]\[$(tput sgr0)\]\[\033[38;5;28m\]\w\[$(tput sgr0)\]\[$(tput sgr0)\]\[\033[38;5;15m\]\n\[$(tput bold)\]\[$(tput sgr0)\]\[\033[38;5;1m\]\\$\[$(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