You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
I have the requirement of copying the bitbucket project from location X to another location Y by retaining all the commit history from source location X. Please advise.
Hi, @chandreddy! Welcome to the community!
If you have administrative rights to this repository, you can change or transfer the ownership of the repository to another workspace. The transferred repository comes with its commit history and wiki, but it will lose the access groups and won’t inherit the destination account's default access groups. You'll have to set those on the repository after the transfer.
In order to transfer the repository ownership, you can follow the next steps:
Access the repository you want to transfer > click Repository settings in the left menu.
Select the option Manage repository > click Transfer repository.
Enter the Workspace ID of the workspace in which you want to transfer the repository.
Click Transfer.
Then, Bitbucket will send an email to the new owner or workspace administrators containing the transfer request with a link to the page that allows the user to accept or reject the transfer.
Please let us know if you have any questions about this process.
Kind regards,
Caroline
Thanks @Caroline R . Do old repository remains or does it gets deleted? I want to keep old one without deleting.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @chandreddy,
Please allow me to step in here as Caroline is out of office.
If you transfer a repository, it will not remain in the original workspace.
Just to make sure I understand your requirements, when you say "copying the bitbucket project from location X to another location Y", by "location" you mean another Bitbucket workspace?
If so, then I can suggest two different options:
1. You can fork the repository to the same or different workspace
While viewing the repository on Bitbucket website, select the Source page, then select the 3 dots near the top right corner (next to the option Clone) > Fork this repository.
This option will be visible if forking is allowed for this specific repo.
The fork is linked to the original repo, so you have the option to sync it with the original one when more commits are made to it, and you can also create PRs from the fork to the original repo.
2. If syncing the two repos or creating PRs is not a requirement, you can also do the following:
git clone --mirror <repo-url>
git push --mirror <url-of-the-new-empty-repo>
Please feel free to let us know if you have any questions.
Kind regards,
Theodora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Theodora Boudale Thank you very much for your reply. Just to clarify for both the options will have commit history from the original repo right?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @chandreddy, you are very welcome, and to answer your question, yes, indeed.
With both options, all the commit history of the original repo will be copied to the new repo.
Please feel free to let us know if you have any questions when you try this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Theodora Boudale Thanks. Can I also assume that mirror would also copy all branches feature, master etc would also be copied from the original repo?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Theodora Boudale never mind, I tried mirror and all branches got copied along with history. Thanks heaps both @Theodora Boudale and @Caroline R for your help on time.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @chandreddy,
You are very welcome, we're glad to have helped.
The purpose of the --mirror flag in the clone command is to get all branches, if you do a 'git clone' without --mirror then you get locally only the main branch of the repo.
It's good to hear that you figured this out, if you ever need anything else, please feel free to reach out!
Kind regards,
Theodora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Theodora Boudale and @Caroline R
After copying the old repo to new repo using Mirror option, some how both old and new repo are in Sync. That means all the commits that are done in new repo can also be seen and accessed in old repo. Having said this, we are not sure what is the impact if we try to delete the old repo that might cause everything gets deleted in new repo as well. Looks like they are in sync both ways?
I thought Mirror option does not do the sync of the both repos. I don't want to keep both in sync. Please advise.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Theodora Boudale and @Caroline R ,
I was able to fix the issue by updating the SCM properties in pom.xml to point to new repo and now problem is solved. On another note, I need to copy some of the tags from old repo to new repo is that possible and how?
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.