Skip to content

Instantly share code, notes, and snippets.

@tanmay27vats
Created March 12, 2022 11:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tanmay27vats/97b11d73092da55e67906509ccb521d1 to your computer and use it in GitHub Desktop.
Save tanmay27vats/97b11d73092da55e67906509ccb521d1 to your computer and use it in GitHub Desktop.
Add git branch name to shell prompt in Ubuntu with custom text. Sudo nano ~/.bashrc
# Colors definition
BLUE='\e[94m'
L_BLUE='\e[96m'
YELLOW='\e[93m'
GREEN='\e[32m'
L_GREEN='\e[92m'
RED='\e[31m'
L_RED='\e[91m'
NC='\e[0m'
export GIT_PS1_SHOWDIRTYSTATE=true # show * for changes
export GIT_PS1_SHOWUNTRACKEDFILES=true # show % for new files
#export PS1="$GREEN\u$YELLOW@$L_GREEN\h$YELLOW: $BLUE\W $L_RED\$(__git_ps1)$NC $ "
# Something stylish & cool with custom text. ;)
export PS1="$GREEN\u$YELLOW is working on $BLUE\W$L_GREEN @$L_RED\$(__git_ps1)$NC $ "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment