_PushLocalGitProject
This kind of push overwrites the contents of the Bitbucket repository. You should use it with great caution.
- Create an empty repository in Bitbucket.
- Open a shell on your local machine (GitBash terminal for Windows users).
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.)Navigate to the root directory of the repository you want to push.
$ cd ~/repos/originalrepo
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.