Created
March 4, 2019 14:53
-
-
Save dariodaich/4cb7f60b78f4b8683d69bf6025731d3b to your computer and use it in GitHub Desktop.
Display Git branch in your prompt.
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
# !/bin/bash | |
function simple_git_branch() { | |
if [ -n "$(ls -la | grep '.git$')" ]; then | |
echo "$(git branch | grep '^*' | colrm 1 2)" | |
else | |
echo "~" | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment