How to git push an existing repository/project to Bitbucket Cloud

Platform Notice: Cloud and Data Center - This article applies equally to both cloud 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

Summary

In some scenarios, it might be necessary to migrate git repositories from other code hosting platforms, or even from a local machine, into Bitbucket Cloud. The goal of this page is to guide users on how to push an already existing git repository to Bitbucket Cloud.

Steps

  1. Go to bitbucket.org and make sure that a workspace and a repository has already been created, for example, workspace-example and repo-example. Please note that these names are just examples and should be changed to the actual name. Please use the documentation below to assist you on these steps:
  2. Mirror clone the repository, as the mirror clone contains all content of a repository:
  3. The repository has been cloned into the "temp" directory as per the above command.
    • Move into "temp" folder:

      cd temp
  4. Now that the repository was cloned using the --mirror flag, the remote-url needs to be changed.
  5. The last step is to push all content of the mirror cloned repository to Bitbucket Cloud:
    • With the command below all content, including branches and tags, will be pushed to Bitbucket Cloud.

      git push -u cloud --all && git push -u cloud --tags
Last modified on Aug 29, 2024

Was this helpful?

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