mercurial - Convert multiple hg repositories to single git repository with multiple branches -
i switching git mercurial , have been using hg-fast-export successfully. have tricky situation. have project using separate hg repositories per-branch , want convert these single git repository 'proper' branches, keeping hg changesets if possible.
so current structure looks - each folder hg repository:
project-v1.0 project-v2.0 project-v3.0
i want end single git repository called 'project' contains 3 branches, v1.0, v2.0 , v3.0.
is possible?
when hg repositories clones 1 base repo, can use hggit extension export them 1 git repo. branches live in directories b1/, b2/ , b3/, need to
cd b1; mkdir ../gb1 && git init --bare ../gb1 && hg push ../gb1; cd .. cd b2; mkdir ../gb1 && git init --bare ../gb2 && hg push ../gb2; cd .. cd b3; mkdir ../gb1 && git init --bare ../gb3 && hg push ../gb3; cd .. # have 1 git repo each hg branch cd gb1 git remote add gb2 ../gb2 git remote add gb3 ../gb3 git fetch --all # have branches in gb1 repo rm -r ../gb2 ../gb3 # other repos not used anymore
if different hg repos unrelated, have use graft point solution vonc mentioned.
Comments
Post a Comment