Skip to content

Instantly share code, notes, and snippets.

@Ivoz
Created September 14, 2012 20:37
Show Gist options
  • Save Ivoz/3724635 to your computer and use it in GitHub Desktop.
Save Ivoz/3724635 to your computer and use it in GitHub Desktop.
function scm_branch {
if git branch &>/dev/null; then
git branch | grep '*' | cut -c 3-
echo -n ' '
fi
if hg root &>/dev/null; then
hg summary | head -n 2 | tail -n 1 | cut -d ' ' -f2
echo -n ' '
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment