Ajith K
Ajith K

Reputation: 591

Move code from Mercurial to Bitbucket

Currently, I have Mercurial as my version control in Kiln server. I want to migrate my code to Bitbucket server with Git. I have tried the import option available in Bitbucket but I can only import as a Mercurial repository.

Is there any possible way to achieve this?

Upvotes: 4

Views: 1449

Answers (3)

Marina Liu
Marina Liu

Reputation: 38096

Except the fast-export tool, there is an easy way to migrate Hg to git:

Initial a local git repo

mkdir git
cd git
git init 

Clone hg repo

cd ..
hg clone <URL for hg_repo>
cd <hg_repo>
hg bookmarks hg
hg push ../git

Get changes from hg repo in local git repo

cd ../git
git checkout hg

Create an empty git repo on bitbucket, and push local git repo to it

git remote add origin <URL for bitbucket repo>
git push -u origin hg

Upvotes: 2

phd
phd

Reputation: 94397

I have a very positive experience with git-remote-hg.

Upvotes: 1

s.m.
s.m.

Reputation: 8043

You probably need to do the Mercurial -> Git conversion on your own machine with a tool like fast-export.

You then create a new repo on Bitbucket and follow the instructions to push your project to it. You shouldn't hit any major roadblocks.

This answer will give you further information on how to do it.

Upvotes: 1

Related Questions