Skip to content

Instantly share code, notes, and snippets.

@markpasc
Created September 30, 2009 17:28
Show Gist options
  • Save markpasc/198272 to your computer and use it in GitHub Desktop.
Save markpasc/198272 to your computer and use it in GitHub Desktop.
which vcs am i using again?
#!/bin/sh
# which vcs am i using again?
if [ -e .svn ]
then
echo "svn"
fi
git rev-parse --is-inside-work-tree > /dev/null 2> /dev/null
if [ 0 -eq $? ]
then
echo "git"
git svn info --url > /dev/null 2> /dev/null
if [ 0 -eq $? ]
then
echo "svn"
fi
fi
hg status > /dev/null 2> /dev/null
if [ 0 -eq $? ]
then
echo "hg"
if [ -n "`hg gremote`" ]
then
echo "git"
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment