_PushLocalGitProject

On this page

Still need help?

The Atlassian Community is here for you.

Ask the community

This kind of push overwrites the contents of the Bitbucket repository. You should use it with great caution.

  1. Create an empty repository in Bitbucket.
  2. Open a shell on your local machine (GitBash terminal for Windows users).
  3. Verify your SSH key is working.

    $ ssh -T git@bitbucket.org
    conq: logged in as tutorials.

    You can use git or hg to connect to Bitbucket. Shell access is disabled.

    The message should report you are logged in as your Bitbucket account. In this example, my ssh key was on my tutorials account. If you don't get this message, stop and troubleshoot your SSH connection to Bitbucket. (See Troubleshoot SSH issues for information about doing this.)

  4. Navigate to the root directory of the repository you want to push.

    $ cd ~/repos/originalrepo
  5. Push the local repo up to Bitbucket

    $ git push --mirror git@bitbucket.org:tutorials/exploratory

    This command pushes your local repository to the Bitbucket server.

Last modified on Nov 15, 2017

Was this helpful?

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