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

Still need help?

The Atlassian Community is here for you.

Ask the community


Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

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

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.

Summary

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.
      (info) 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.
      (info) 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:

      cd bare-git-repo-converted-from-cvs
      
      git remote add origin URL_OF_BITBUCKET_REPOSITORY
      git push -u origin --mirror
      

      (warning) --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.


Last modified on Jul 20, 2023

Was this helpful?

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