Skip to content

Instantly share code, notes, and snippets.

@darrinholst
Created August 24, 2012 12:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save darrinholst/3450100 to your computer and use it in GitHub Desktop.
Save darrinholst/3450100 to your computer and use it in GitHub Desktop.
type git, type hg, this script don't care
export ORIGINAL_GIT=`which git`
export ORIGINAL_HG=`which hg`
git() {
if [ -d .hg ]; then
echo "perhaps you meant hg?"
"$ORIGINAL_HG" $@
else
"$ORIGINAL_GIT" $@
fi
}
hg() {
if [ -d .git ]; then
echo "perhaps you meant git?"
"$ORIGINAL_GIT" $@
else
"$ORIGINAL_HG" $@
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment