Created
November 14, 2018 13:55
-
-
Save muayyad-alsadi/c7b8713d7dc2394e3edc591c6ff0bdac to your computer and use it in GitHub Desktop.
add git branch to bash prompt
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
# add the below to your ~/.bash_profile | |
parse_git_branch() { | |
[ -d .git ] && { | |
echo -n '@' | |
git rev-parse --abbrev-ref HEAD | |
} | |
} | |
export PS1='[\u@\h \W$(parse_git_branch)]\$ ' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment