Bitbucket is getting a new navigation

We’re rolling out these changes, so the documentation may not match your experience in the Bitbucket Cloud app. Read about the new Bitbucket navigation

リモート URL をリポジトリに変更する

リポジトリのリモート URL を変更するには、新しい URL を使用して構成ファイルを更新する必要があります。これを行わない場合、リポジトリをプッシュしようとするとエラーが表示されます。構成ファイルを編集したくない場合は、新しい場所からリポジトリをクローンすることもできます。クローンを作成する場合、転送前に Bitbucket にプッシュしていないすべての変更が失われることに注意してください。

リポジトリに使用する URL は、HTTPS または SSH のどちらのプロトコルを使用しているかによって異なります。これらの URL は、リポジトリの [ソース] ページの [クローン] ボタンで確認できます。

You can go 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.

URL の一部として次の名前が表示されます。

  • <repo_name> にはリポジトリ名が表示されます。

  • HTTPS URL 形式の場合、<workspace_ID> にはワークスペースのワークスペース ID が表示されます。

Git リポジトリ URL

HTTPS 形式

https://<your_username>@bitbucket.org/<workspace_ID>/<repo_name>.git

SSH 形式

git@bitbucket.org:<workspace_ID>/<repo_name>.git

または

ssh://git@bitbucket.org/<workspace_ID>/<repo_name>.git


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

  1. ターミナルでリポジトリに移動します。$ cd ~/<path_to_repo>)

  2. 現在のリモート URL を表示するには、git remote -v を実行します。

    $ git remote -v
    origin https://emmap1@bitbucket.org/tutorials/tutorials.git.bitbucket.org.git (fetch)
    origin https://emmap1@bitbucket.org/tutorials/tutorials.git.bitbucket.org.git (push)

  3. 現在のリモート URL と新しいリモート URL を使用して、リモート URL を git で更新します。
    $ git remote set-url origin git@bitbucket.org:tutorials/tutorials.git

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

 

さらにヘルプが必要ですか?

アトラシアン コミュニティをご利用ください。