Skip to content

Instantly share code, notes, and snippets.

@dariodaich
Created March 4, 2019 14:53
Show Gist options
  • Save dariodaich/4cb7f60b78f4b8683d69bf6025731d3b to your computer and use it in GitHub Desktop.
Save dariodaich/4cb7f60b78f4b8683d69bf6025731d3b to your computer and use it in GitHub Desktop.
Display Git branch in your prompt.
# !/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