Created
December 25, 2020 12:54
-
-
Save adomingues/2e8e8a0d458ad9bb1e9857b0c4ca197f to your computer and use it in GitHub Desktop.
Convert hg (mercurial) to git repos
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
find . -maxdepth 2 -name ".hg" -type d | |
## convert hg to git | |
pip install mercurial ## apt install did not work with the conversion tool | |
## install conversion tool | |
mkdir -p ~/bin | |
cd ~/bin/ | |
git clone https://github.com/frej/fast-export.git | |
## convert - make sure all chnages are commited | |
reponame="some_repo" | |
basedir="/home/adomingu/imb-kettinggr/adomingues/projects" | |
hgdir="${basedir}/${reponame}" | |
gitdir="${basedir}/git_repos/${reponame}" | |
git init ${gitdir} | |
cd ${gitdir} | |
~/bin/fast-export/hg-fast-export.sh -r ${hgdir} | |
git checkout HEAD |
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
find . -maxdepth 2 -name ".hg" -type d | |
## convert hg to git | |
pip install mercurial ## apt install did not work with the conversion tool | |
## install conversion tool | |
mkdir -p ~/bin | |
cd ~/bin/ | |
git clone https://github.com/frej/fast-export.git | |
## convert - make sure all chnages are commited | |
reponame="some_repo" | |
basedir="/home/adomingu/imb-kettinggr/adomingues/projects" | |
hgdir="${basedir}/${reponame}" | |
gitdir="${basedir}/git_repos/${reponame}" | |
git init ${gitdir} | |
cd ${gitdir} | |
~/bin/fast-export/hg-fast-export.sh -r ${hgdir} | |
git checkout HEAD |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment