Created
September 26, 2019 10:24
-
-
Save smaknsk/d20d5038f1af9fe2bb00a00346186c3b to your computer and use it in GitHub Desktop.
Git branch in terminal
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 in prompt. | |
function parse_git_branch { | |
ref=$(git symbolic-ref HEAD 2> /dev/null) || return | |
echo "("${ref#refs/heads/}")" | |
} | |
PS1="\[\033[00;32m\]\u@\h\[\033[00m\]:\[\033[00;33m\]\w\[\033[00;31m\]\$(parse_git_branch)\[\033[00m\]\$ " | |
EDITOR="mcedit" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment