How to convert existing CVS repository to GIT and import it to Bitbucket Server / Data Center

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

The content on this page relates to platforms which are not supported. Consequently, Atlassian Support cannot guarantee providing any support for it. Please be aware that this material is provided for your information only and using it is done so at your own risk.

This article explains how to convert existing CVS repository to GIT using cvs2git tool.and import it to Bitbucket Server / Data Center.

Environment

8.11 but also applicable to other versions.

Solution

Reference how to install and use cvs2git tool is given on cvs2git usage page.

  1. On workstation where there is a CVS repository:

    • Download, install, configure cvs2git tool and do the conversion following steps 1-8 from cvs2git usage page.

    • Result of conversion will be GIT bare repository.

      ℹ️ There is no need to convert it to non-bare repo.

  2. On a Bitbucket server:

    • Use web interface to create a new repository, and grant necessary access permissions.

    • After GIT repository is created, you can see its URL when you choose "Clone" button in Bitbucket’s page of this repository.

      ℹ️ URL_OF_BITBUCKET_REPOSITORY in next step relates to this URL.

  3. Back on a workstation with bare GIT repository:

    • Enter directory with bare GIT repo, add Bitbucket GIT repo as a remote, and then push contents to Bitbucket server:

      1 2 3 4 cd bare-git-repo-converted-from-cvs git remote add origin URL_OF_BITBUCKET_REPOSITORY git push -u origin --mirror

      ⚠️ --mirror option to git push will overwrite history of remote repository, so be sure that URL_OF_BITBUCKET_REPOSITORY points to your new, empty Bitbucket repository.

    • Make a new, fresh "git clone" from your Bitbucket repository into a new directory on your workstation. Then, check if all files and branches are there.

      If all is well, you can remove temporary bare GIT repository that was used to import data into Bitbucket.

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.