Skip to content

Instantly share code, notes, and snippets.

@alfredobarron
Last active March 20, 2020 17:27
Show Gist options
  • Save alfredobarron/5fa8c83b467966c11b7991ded41e172d to your computer and use it in GitHub Desktop.
Save alfredobarron/5fa8c83b467966c11b7991ded41e172d to your computer and use it in GitHub Desktop.
Show branch into Mac Terminal --> 1. nano ~/.bash_profile 2. Edit file 3. source ~/.bash_profile
if [ $PWD == $HOME ]
then
cd Code
fi
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\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