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

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

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.

Solution

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:

      1 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.

      1 git push -u cloud --all && git push -u cloud --tags
Updated on April 2, 2025

Still need help?

The Atlassian Community is here for you.