I'm new to bitbucket and haven't used git so much either. I have always worked locally with a git desktop GUI, and I've versioned my software development locally. Now I created a bitbucket account and I want to upload my code with all commit history. Is there a way to do it, or do I have to start from where I am now? I don't mind if I need to use Sourcetree or just the command line.
I'm looking forward to hearing from you!
Hi Adrian, welcome to the Community!
The history of a repo is stored in the .git directory. When you clone a repository, this directory is getting copied too, so the history will remain. Metadata, such as pull requests and Bitbucket comments are not stored, you'll need to reproduce those manually, though.
Hope that helps!
Ana
Thank you very much... looks exactly what I want. Which are the steps required to clone a repository FROM local TO Bitbucket? Or if there's already a tutorial, please send me the link, I couldn't find one for windows.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
First, you'll need to create the repository (or repositories) on Bitbucket first. Leave them empty and do the rest from your system.
Next, go to the local repo and add the remote:
git remote add bitbucket https://username@bitbucket.org/owner/repo.git
OR
git remote add bitbucket git@bitbucket.org:owner/repo.git
where "username" is your username; "owner" is the repository's owner (which might be the same as your username); and "repo" is the name of the repository on Bitbucket. You can name the remote "bitbucket", as I've done in this example, or "origin", or any name that you are not already using.
Then push:
git push bitbucket --mirror
That will populate the repository on the "bitbucket" remote with all branches and tags from your local copy. Please see https://git-scm.com/docs/git-push for more options with the push command.
If you're using a GUI client, like SourceTree, then the concepts are the same (create the repo on BB, add the remote, then push to it) but the specific things to click will vary.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Great!!!! I've done it successfully!! Thank you very much, now I'll be uploading all my local version control projects here!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So glad to hear that, Adrián! If you need anything else, let us know :)
Have a nice day,
Ana
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.