Convert from other version control systems

Converting from SVN to Git?

Atlassian experts have written an exceptional guide: Migrate to Git from SVN

Converting from SVN or another VCS to Mercurial?

Conversion to a Mercurial repository is easy. Mercurial ships with a convert extension that supports conversion from these systems:

  • Bazaar (experimental, but should work)
  • CVS
  • Darcs (experimental, but should work)
  • Git
  • GNU arch (experimental, but should work)
  • monotone (experimental, but should work)
  • Subversion (SVN)

Follow our detailed guides for:

Importing Code

You can import your code into Bitbucket Cloud without converting it to Mercurial. For instructions, see Import code from an existing project.

  • An excellent Mercurial manual – enter hg convert without specifying any arguments to read the manual
  • ConvertExtension on the Mercurial Wiki

Was this helpful?

Thanks for your feedback!

Why was this unhelpful?

3 Archived comments

  1. User avatar

    Eric Anderson

    The documentation for converting from other version control systems should be updated to include the standard method of using fast-export with fast-import.  This works quite well and can be used to go to either Git or Mercurial from many other version control systems, including but not limited to Bazaar.  Here I give an example going from Bazaar to Git.


    $ # Starting in your local Git project directory, or anywhere you like...
    $ git init localGitRepoName
    $ cd localGitRepoName
    $ bzr fast-export --plain --rewrite-tag-names /path/to/Bazaar/master/branch | git fast-import
    $ git reset --hard HEAD
    $ git mv .bzrignore .gitignore
    $ git commit -m "Convert Bazaar repository to a Git repository."
    $ git gc
    $ # After creating an empty Bitbucket repository, the remaining steps come
    $ # from the Bitbucket instructions to push to the Bitbucket repository.
    $ git remote add origin theAppropriate.gitRepositoryString
    $ git push -u origin --all
    $ git push -u origin --tags


    Any version control system that supports fast-export could be used in this way to convert to either Git or Mercurial.

    Special case: If someone has information (e.g. issue number information) in the special Bazaar field for this that they want to retain in the converted repository (but which would be stripped off by the --plain processing), they can consider the script solution discussed and provided by this link.


    26 Jun 2014
  2. User avatar

    Eric Anderson

    p.s. In my example above, there is the step of resetting the staging area and populating the files in the working directory after the fast-export and fast-import, which is done using this reset command.

    $ git reset --hard HEAD

    For that step, the possible alternative of...

    $ git checkout master

    ...also works (though Git complains "Already on 'master' ").  That alternative approach is suggested by this page:


    As one other reference for those interested, various other embellishments, details, and optional extra conversion steps are suggested by this page.


    In any case, though it is not mentioned in some other examples of using fast-export, whatever else one does, I do recommend keeping the fast-export argument


    If there are any tags in the original repository with characters that are not valid in a Git tag, this option will ensure that instead of skipping those tags, the offending disallowed characters will be replaced by underscores and the rewritten tag will be retained in the new Git repository.


    26 Jun 2014
    1. User avatar

      Dan Stevens [Atlassian]

      Good stuff Eric! Thanks! I'll add this to my updates and testing backlog. (smile)

      30 Jun 2014
Powered by Confluence and Scroll Viewport