Hi,
I am currently using Bitbucket server v6.3.2 and planning to migrate to Bitbucket cloud. However, my current Bitbucket server is behind the firewall. I only see documents on how to import from an externally accessible Bitbucket server. Is there any way that I can clone the repo from the current Bitbucket server to my local mac laptop, then upload/import the code with all history into the new repo in the Bitbucket cloud? How? Any step-by-step instruction?
Thank you.
Barry
from @Mikael Sandberg who is having issues trying to post this reply:
testing to post here
For more information visit https://confluence.atlassian.com/bitbucket/push-versioned-code-to-an-empty-repository-877177145.html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Monique, thank you for your quick response. Yes, I found that link also. It is not easy to find tho.
So, I followed the instruction but got the following error with a brand new repo. How can I resolve it? Thanks.
mp-ml-081:master bonnie$ git remote set-url origin https://scm@bitbucket.org/scm/commons.git
mp-ml-081:master bonnie$ git push -u origin -all
error: did you mean `--all` (with two dashes ?)
mp-ml-081:master bonnie$ git push -u origin --all
Password for 'https://scm@bitbucket.org':
To https://bitbucket.org/pscm/commons.git
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'https://scm@bitbucket.org/scm/commons.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Barry,
When you created the repository in Bitbucket, did you choose not to add a readme file in it? The error you get indicates that the remote repository, in Bitbucket, isn’t empty.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Okay, so try this. Delete the new repository that you just imported to and creat it again, make sure that you do not add the readme file at the end. When you clone the repository on your Bitbucket server, use git clone —mirror, this will create a bare clone which can only be used for backup. Then when you push it to Bitbucket Cloud, make sure you use the —mirror again in the gut push command. This will recreate all the branches and tags.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Mikael,
1) I think the initial issue is caused by .gitignore file being created. Not the Readme file (This may cause it too but I did not choose to create Readme file).
2) "git clone --mirror..." with cloning then using "git push -u origin --mirror" seem to import all the branch and tags information.
Thank you.
Barry
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Testing to post an answer here
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.