Created
November 29, 2019 02:57
-
-
Save celsobessa/25736f7a9ef94969a4e03c3873ee8a3e to your computer and use it in GitHub Desktop.
show git branch on your terminal prompt for unix like systems (unix, linux, macOs)
This file contains hidden or 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 this to ~/.bashrc | |
| git_branch() { | |
| git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
| } | |
| export PS1="[\u@\h \W]\$(git_branch)\$ " |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment