If you have administrative rights to a repository, you can change or transfer the ownership of a repository to another workspace or to an individual account. To complete the transfer, the new account holder must accept the repository. The transferred repository also comes with its commit history, issue tracker, and wiki.
When your transfer is accepted, Bitbucket Cloud automatically updates the repository URL on Bitbucket with the new owner's account name.
Because the repository URL changes on Bitbucket, you (and everyone who accesses it locally) need to change the URL locally so that it can reference the new URL. Alternatively, you can re-clone the repository.
The transferred repository loses all access groups and doesn't inherit the destination account's default access groups. You'll have to set those on the repository after the transfer.
Transfer a repository
Make sure you know which user you want to transfer the repository to before you begin.
- From the repository you want to transfer, click Repository settings in the left menu.
- From the Repository details page, scroll down and you'll see Transfer or delete repository. Click Transfer repository to open the Transfer repository window.
- Enter the Workspace ID of the workspace in which you want to transfer the repository.
- Click Transfer.
Bitbucket sends 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. If the account holder has administrative access on more than one account, he or she can transfer the repository into any of these accounts.
While the transfer is pending, the repository displays a banner with those details at the top to warn others who have access to your repository that a transfer is pending. You are able at any time before the new user accepts it. If you revoke a transfer before a user accepts it, Bitbucket sends the user a notification that the transfer was rescinded.
Accept a transferred repository
If you receive a transfer request, accept it by doing the following:
- Open the transfer request email.
- Click the link provided to open the Transfer repository ownership screen. If you're not logged in to Bitbucket, you'll have to log in first.
- If the repository is being transferred to a workspace, pick a project.
- Click Accept.
Once you accept the request, the repository shows up on your list of repositories. Bitbucket updates all URLs on the server and the repository is accessible from its new location. The original owner of the repository will still have administrative access to the repository at its new owner/location. To change or remove this access, go to the repository's Repository settings > User and group access page. If you reject a transfer, Bitbucket sends a message to the sender of the request.
Update local configuration files with the new repository URL
When you transfer a repository, the Bitbucket URL changes. As a result, you need to update the local URL to maintain its connection with the remote repository.
You can click back and forth between the SSH and the HTTPS protocol links to see how the URLs differ. The table below shows how the formats vary based on protocol.
You'll see these names as part of the URL:
In place of
<repo_name>, you'll see the repository name.
In place of
<workspace_ID>in the HTTPS URL format, you'll see the workspace ID for your workspace.
|Git repository URLs|
Update the URL for Git repositories
From a terminal, navigate to the repository.
$ cd ~/<path_to_repo>
git remote -vto see the current remote URL.
$ git remote -v
Update the remote URL with
git remote set-urlusing the current and new remote URLs.
$ git remote set-url origin email@example.com:tutorials/tutorials.git.bitbucket.org.git
If you update your URL from HTTPS to SSH, next time you push or pull from your repository, the terminal responds that it is adding the Bitbucket host to the list of known hosts. You also won't have to enter a password.