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-keygenif you don't have one)
- Then you have an URL for cloning like this: firstname.lastname@example.org:your_user/your_repo.git
- Then go to the folder where your repo is:
- Then upload it to Bitbucket:
git push --mirror email@example.com: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