Created
March 18, 2010 22:30
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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