Import or convert code from an existing tool
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, Subversion, 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.
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.
If your Git repository is on a self-hosted server (for example, Bitbucket Server), you must be running Git services to import the repository.
Because Bitbucket doesn't host Subversion repositories, when you import from a Subversion repository, the importer:
- exports a working copy of your trunk code base
- builds a new DVCS repository
- commits the entire working copy as a single DVCS changeset into the new repository on Bitbucket.
Bitbucket does not retain the history when importing code from Subversion. If you'd like to retain your Subversion revision history in Bitbucket, you must perform an offline synchronization. This may take a long time to complete and be CPU intensive, depending on the size of your repository, the number of revisions, branches and tags in your repository.
To import code do this:
- Choose Repositories > Import repository from the menu bar.
- Select the Source of the code you want to import.
Depending on the Source, the system asks you to provide the following information:
Source Information you must supply CodePlex URL, Project name, Repository type Git/GitHub URL, a Username/Password combination for private repositories that Require authorization Google Code URL, Project name, Repository type Mercurial URL, a Username/Password combination for private repositories that Require authorization SourceForge URL, Project name, Repository type Subversion URL, a Username/Password combination for private repositories that Require authorization
- Enter a Name for your new repository.
- Uncheck Private if you want the repository to be Public.
- Select a Language.
- Click Issue tracking and/or Wiki if you want those features.
- Enter a Description and Website if you wish.
- Press Import.
- Clone your repository.
Convert from Subversion
Convert from 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
Convert from 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:
hg convertwithout 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:
Subversion (see the following section for more information)
Where do you go next?
Was this helpful?
Thanks for your feedback!