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 projects on Bitbucket Cloud (see the relevant SSH setup guide for your operating system).

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

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

    ~/project2/.gitconfig

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

    [includeIf "gitdir:~/project1/"] path = ~/project1/.gitconfig [includeIf "gitdir:~/project2/"] path = ~/project2/.gitconfig

    これによって、プロジェクト フォルダーに複製されたすべてのリポジトリ (~/project1/repo1 など) が同じ Git 構成とアクセス キー (~/project1/.gitconfig など) を使用できるようになります。

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

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