Transfer repository ownership

If you have administrative rights to a repository, you can change or transfer the ownership of a repository to another team or to a 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.

  1. 譲渡したいリポジトリで、左側のメニューの [設定] をクリックします。
  2. [リポジトリの詳細] ページで下にスクロールすると、[リポジトリの譲渡または削除] が表示されます。[リポジトリの譲渡] をクリックし、[リポジトリの譲渡] ウィンドウを開きます。
  3. Enter the Owner, either the username of the individual or team ID, to whom you want to transfer the repository.
  4. [転送] を押します。

Bitbucket sends an email to the new owner or team 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 to revoke the transfer request 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:

  1. Open the transfer request email.
  2. 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.
  3. If the repository is transferring to a team, pick a project.
  4. Press 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 it's new location. The original owner of the repository automatically has delegated administrative access to the repository at its new owner/location. To change or remove this access, go to the repository's 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.

The URL you use for a repository depends on which protocol you're using: HTTPS or SSH. You can find these URLs from the  Clone button on the Source page of your repository.

SSH プロトコルと HTTPS プロトコルのリンクを交互にクリックすると、URL の違いを確認できます。下の表は、プロトコルに基づくフォーマットの違いを示しています。

You'll see these names as part of the URL:

  • In place of <repo_name>, you'll see the repository name.
  • In place of <your_username> in the HTTPS URL format, you'll see the username for your individual account.
  • In place of <account_name> for all URL formats, you'll the user or team name for the account that owns the repository.
    <your_username> and <account_name> may be the same if you're looking at the URL for a repository you own.
Git repository URLs
HTTPS format https://<your_username><account_name>/<repo_name>.git
SSH format<account_name>/<repo_name>.git



Mercurial repository URLs
HTTPS format https://<your_username><account_name>/<repo_name>
SSH format ssh://<account_name>/<repo_name>/

Git リポジトリの URL を更新する

  1. ターミナルでリポジトリに移動します。

    $ cd ~/<path_to_repo>
  2. 現在のリモート URL を表示するには、git remote -v を実行します

    $ git remote -v
    origin (fetch)
    origin (push)
  3. 現在のリモート URL と新しいリモート URL を使用して、リモート URL を git remote set-url で更新します。

    $ git remote set-url origin

HTTPS から SSH に URL を更新すると、次にリポジトリからプッシュまたはプルを行ったときに、ターミナルは、Bitbucket ホストを既知のホストのリストに追加することを応答します。また、パスワードを入力する必要はありません。

Mercurial リポジトリの URL を更新する

  1. ターミナルで現在のリポジトリ設定を表示します。

    $ cd ~/<path_to_repo>
    $ cat .hg/hgrc
    default =

    先ほどの例では、default URL は HTTPS プロトコルを使用しています。

  2. 任意のエディタで ~/<path_to_repo>/.hg/hgrc ファイルを開きます。
  3. default の値を、そのリポジトリに使用する URL に変更します。

    default = ssh://
  4. 構成ファイルを保存して閉じます。

HTTPS から SSH に URL を更新すると、次にリポジトリからプッシュまたはプルを行ったときに、ターミナルは、Bitbucket ホストを既知のホストのリストに追加することを応答します。また、パスワードを入力する必要はありません。

最終更新日 2018 年 5 月 10 日


Powered by Confluence and Scroll Viewport.