Created
May 5, 2021 09:41
-
-
Save lil5/cbf7158cccc0252fc514eb67119fc26e to your computer and use it in GitHub Desktop.
Bash with branch
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
# with color prompt | |
PS1="\[\033[95m\]\u@\h \[\033[32m\]\W\[\033[33m\] [\$(git symbolic-ref --short HEAD 2>/dev/null)]\[\033[00m\]\$ " | |
# without | |
PS1="\u@\h \W [\$(git symbolic-ref --short HEAD 2>/dev/null)]\$ " |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://blog.sellorm.com/2020/01/13/add-the-current-git-branch-to-your-bash-prompt/