Importing Mercuial(hg) repository to Team Foundation Services

1.5k Views Asked by At

I'm looking for any suggestions or tools that can be used to migrate a Mercurial(hg) repository on a Windows 7 system to a TFS repository on Visualstudio.com. I currently use TortoiseHg to interface with the Mercuial repository. I had found a post that says i can be done with SVNBridge but no details and it didn't makes sense to me since SVN is different than Mercurial.

1

There are 1 best solutions below

17
On

If you are using Git version control for your VSTS repository, you can use Hg-Git mercurial plugin to convert a hg repository to Git repository.

A link for your reference: Easy Migration from Mercurial to Git

If you are using Team Foundation Version Control (TFVC) for your VSTS repository, there isn't any tool to migration it directly as I know. But you can convert the Mercurial repository to Git repository first and then use git-tfs to convert the Git repository to TFVC repository.

Update: You can following the steps below to do this:

  1. Create a new folder.

  2. Navigate to the created folder and run "git-tfs clone https://xxxx.visualstudio.com/DefaultCollection/ $/Project" command. This will create a local git repo in the folder.

  3. Open the git repo folder and run "git remote add origin " command.

  4. Run "git pull origin yourbranch" command.

  5. Run “git-tfs checkin" command.