Created
March 28, 2018 04:29
-
-
Save KanshuYokoo/61c7df6f4e755b28838b44bd6410ae3f to your computer and use it in GitHub Desktop.
how to retrieve branch name by bash. for the use of bash prompt. very famous script.
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
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment