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

1 台のデバイスで複数のリポジトリ アクセス キーを管理する

SSH 経由で複数の Bitbucket Cloud リポジトリにアクセスする必要があるツールやスクリプトがある場合に、デバイスに複製された各リポジトリの正しい SSH キーによって Git が Bitbucket に接続するためには、いくつかの追加設定が必要です。

読み取り専用のリポジトリ アクセス キーを使用して複数のリポジトリにアクセスするようにデバイスを設定するには、次の手順に従います。

  1. Check that SSH is installed (see the relevant SSH setup guide for your operating system).

  2. ~/.ssh/ ディレクトリ内のリポジトリごとに次のような SSH キー ペアを作成します。

    cd ~/.ssh/ ssh-keygen -t ed25519 -b 4096 -C "{username@emaildomain.com}" -f {ssh-key-name}
  3. Add the public keys to the corresponding repositories on Bitbucket Cloud (see the relevant SSH setup guide for your operating system).

  4. Create or update each repository’s .gitconfig (not the user’s global Git configuration at ~/.gitconfig) to include the core.sshCommand setting, with an ssh command that uses the private key for the repository, such as:
    ~/repository1/.gitconfig

    [core] sshCommand = ssh -i ~/.ssh/repository1_private_ssh-key-name

    ~/repository2/.gitconfig

    [core] sshCommand = ssh -i ~/.ssh/repository2_private_ssh-key-name
  5. Update the user’s global Git configuration file ~/.gitconfig to conditionally include the repository Git configuration files using the includeIf setting. For example:

    [includeIf "gitdir:~/repository1/"] path = ~/repository1/.gitconfig [includeIf "gitdir:~/repository2/"] path = ~/repository2/.gitconfig

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

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