Last active
July 26, 2020 13:18
-
-
Save regisbsb/245496649a710e3756263fa27997849e to your computer and use it in GitHub Desktop.
Get the branch name in the git bash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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) ")' |
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
curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh -o ~/.git-prompt.sh
curl https://gist.githubusercontent.com/regisbsb/245496649a710e3756263fa27997849e/raw/c11f9200dfb82272eaf44b0b6a30ff89fbd3ab0f/.bash_profile ~/.bash_profile