Skip to content

Instantly share code, notes, and snippets.

@amitk
Created October 22, 2020 12:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save amitk/f2a84cf50cf70b908857b305c91c6d97 to your computer and use it in GitHub Desktop.
Save amitk/f2a84cf50cf70b908857b305c91c6d97 to your computer and use it in GitHub Desktop.
Add branch name to you terminal mac/Linux
# in you home direactory in the bash profile to display branch name in terminal add parsing script
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\u@\h \W\[\033[32m\]\$(parse_git_branch)\[\033[00m\] $ "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment