Report inadequate content

Upload an existing Git repository to a remote GitHub, Bitbucket, Beanstalk...

{
}

These are the steps I followed to upload my existing local git repository to a new Bitbucket repository while keeping the whole commit history. You can use this simple steps to move your source code to GitHub, Beanstalk or any other repository you like, commands are just the same. I put as example Bitbucket because you can have unlimited private repositories for free.

How to do it...

  • Register to bitbucket for free, add your SSH key, and create an empty repo.
  • Add your public key to your account under Account > SSH keys (this is just pasting the content after a cat ~/.ssh/id_rsa.pub, write ssh-keygen if you don't have one)
  • Then you have an URL for cloning like this: git@bitbucket.org:your_user/your_repo.git
  • Then go to the folder where your repo is:
    cd /path/to/my/repo
  • Then upload it to Bitbucket:
    git push --mirror git@bitbucket.org:youruser/your_repo.git

That's it, with this you will be able to keep the whole log history, as shown in the sample picture

 TAGS:

{
}
{
}

Comments Upload an existing Git repository to a remote GitHub, Bitbucket, Beanstalk...

Thanks  from Moscow)
Bitbucket User Bitbucket User 20/12/2011 at 11:21
x
x x 14/09/2013 at 06:42
Awesome quick help :)
Aamir Aamir 30/01/2014 at 13:51

Leave your comment Upload an existing Git repository to a remote GitHub, Bitbucket, Beanstalk...

Log in to Obolog, or create your free blog if you are not registered yet.

User avatar Your name