Last active
February 3, 2019 14:46
-
-
Save pdkovacs/1c84b14ada5ea81613d446f8daf634d1 to your computer and use it in GitHub Desktop.
git-branch-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
git_branch_ps() { | |
git_branch=$(git branch 2>/dev/null | grep "^*" | colrm 1 2) | |
if [ -n "$git_branch" ]; | |
then | |
echo " ($git_branch)" | |
fi | |
} | |
export PS1='\u@\w$(git_branch_ps) $ ' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment