Created
January 18, 2015 13:24
-
-
Save drgarcia1986/9436691776f74c28e0c9 to your computer and use it in GitHub Desktop.
Add Git Branch Name to Terminal Prompt (ubuntu)
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
# Import Git script for PS1 | |
source /etc/bash_completion.d/git-prompt | |
# Color definition for PS1 | |
txtred='\e[0;31m' | |
txtwhite='\e[0;37m' | |
txtyellow='\e[0;33m' | |
# Defnite PS1 in this format: | |
# user:dir (git branch)$: | |
# on this colors: | |
# user = white | |
# dir = yellow | |
# branch = red | |
# $ = white | |
PS1="\[$txtwhite\]\u:\[\e[0m\]\[$txtyellow\]\w\[\e[0m\]\[$txtred\]\$(__git_ps1)\[\e[0m\]\[$txtwhite\]\\$\[\e[0m\] " |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment