Import or convert code from an existing tool

Unable to render {include} The included page could not be found.

To get your existing code into Bitbucket Cloud quickly from another hosting site or system, Bitbucket provides an importer to grab a repository. This importer works if you have your code in CodePlex, GitHub, Google Code, SourceForge, or another Git/Mercurial-based hosting site. However, if your hosting site doesn't fall into one of these sources or you don't have a URL to enter, you can convert your code to Git or Mercurial.

On this page

Import from a hosting site

You can import from popular code hosting sites via the Bitbucket importer. When you import code from an external Git or Mercurial repository, the importer simply creates a clone of the repository which is then hosted in Bitbucket.

The importer cannot convert Git repositories to Mercurial repositories or vice versa. 

Importing a Git repo from a self-hosted server?

If your Git repository is on a self-hosted server (for example, Bitbucket Server), you must be running Git services to import the repository.

To import code:

  1. Click + in the global sidebar and select Repository under Create a new.
  2. Click Import repository from the Create a new repository page.
  3. Select the Source of the code you want to import.
  4. Depending on the Source, the system asks you to provide the following information:

    SourceRequired information
    CodePlexURL, Project name, Repository type
    GitURL, a Username/Password combination for private repositories that Require authorization
    MercurialURL, a Username/Password combination for private repositories that Require authorization
    SourceForgeURL, Project name, Repository type
  5. Enter a Name for your new repository.
  6. Uncheck This is a private repository if you want the repository to be public.
  7. Select the Repository type.
  8. Expand Advanced settings and fill out the rest of the page if necessary.
  9. Press Import repository.

Clone your repository when you're done importing it.

Convert from Subversion

If you have a Subversion repository, you need to convert it to Git or Mercurial first before you can import it to Bitbucket.

Subversion to Git

If you have a Subversion (SVN) repository that you'd like to convert to Git, refer to this guide from our Atlassian experts: Migrate to Git from SVN

Subversion to Mercurial

You can import a working copy of your code (i.e. no history) from Subversion into Bitbucket Cloud. Return to the top for more explanation.

See also this Atlassian blog post:  Goodbye Subversion, Hello Mercurial: A Migration Guide.

Option 1: The hgsubversion Extension – Recommended

The hgsubversion extension is a user-contributed extension, but is not distributed with Mercurial. We recommend this extension.  Please refer to the hgsubversion extension guide for download sites and instructions.

Option 2: Mercurial's convert extension

This extension is distributed with Mercurial. Refer to the documentation:

  • Enter hg convert without specifying any arguments to read the Mercurial manual.
  • Read about the ConvertExtension on the Mercurial Wiki.

Convert to Mercurial

So that you can convert a repository to Mercurial, it ships with a convert extension that supports conversion. For more information about the convert extension, refer to the Mercurial wiki. It allows you to convert from these systems:

  • Bazaar
  • CVS
  • Darcs
  • Perforce
  • RCS
  • Git
  • Subversion (see the following section for more information)

Last modified on Aug 20, 2019

Was this helpful?

Provide feedback about this article
Powered by Confluence and Scroll Viewport.