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.
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
@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?
It looks like you're new here. Sign in or register to get started.