Skip to content

Instantly share code, notes, and snippets.

@DarthNerdus
Created March 18, 2010 22:30
Show Gist options
  • Save DarthNerdus/336996 to your computer and use it in GitHub Desktop.
Save DarthNerdus/336996 to your computer and use it in GitHub Desktop.
Converts a folder containing a hg-git clone to an pure git clone.
# Convert.sh - Converts a folder containing a hg-git clone to an pure git clone.
function convert() {
local path
for path in "$@"; do
gitpath="$(/bin/cat $path/.hg/hgrc 2>/dev/null | /usr/bin/grep -o "git://.*")"
if [ x$gitpath != x ]
then
rm $path
/usr/local/bin/git clone $gitpath
else
echo "$path is not a hg-git clone. Conversion aborted."
fi
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment