

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# AWS CodeCommit コマンドラインリファレンス
<a name="cmd-ref"></a>

このリファレンスは、 AWS CLIの使用方法について説明します。

**をインストールして設定するには AWS CLI**

1. ローカルマシンで、 をダウンロードしてインストールします AWS CLI。これは、コマンドラインから CodeCommit とやり取りするための前提条件です。 AWS CLI バージョン 2 のインストールが推奨されます。これは の最新バージョン AWS CLI であり、すべての最新機能をサポートしています。これは、 でルートアカウント、フェデレーティッドアクセス、または一時的な認証情報の使用 AWS CLI をサポートする の唯一のバージョンです**git-remote-codecommit**。

   詳細については、[AWS 「 コマンドラインインターフェイスのセットアップ](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-set-up.html)」を参照してください。
**注記**  
CodeCommit は AWS CLI バージョン 1.7.38 以降でのみ動作します。ベストプラクティスとして、 をインストールまたは最新バージョン AWS CLI にアップグレードします。インストール AWS CLI した のバージョンを確認するには、 **aws --version** コマンドを実行します。  
の古いバージョン AWS CLI を最新バージョンにアップグレードするには、[「 のインストール AWS Command Line Interface](https://docs.aws.amazon.com/cli/latest/userguide/installing.html)」を参照してください。

1. このコマンドを実行して、 の CodeCommit コマンド AWS CLI がインストールされていることを確認します。

   ```
   aws codecommit help
   ```

   このコマンドは、CodeCommit コマンドのリストを返します。

1. 次のように、 **configure** コマンドを使用して プロファイル AWS CLI で を設定します。

   ```
   aws configure
   ```

   プロンプトが表示されたら、CodeCommit で使用する IAM ユーザーの AWS アクセスキーと AWS シークレットアクセスキーを指定します。また、 など、リポジトリが存在する AWS リージョン を必ず指定してください`us-east-2`。デフォルトの出力形式の入力を求められたら、`json` を指定します。例えば、IAM ユーザーのプロファイルを設定する場合は、次のようにします。

   ```
   AWS Access Key ID [None]: Type your IAM user AWS access key ID here, and then press Enter
   AWS Secret Access Key [None]: Type your IAM user AWS secret access key here, and then press Enter
   Default region name [None]: Type a supported region for CodeCommit here, and then press Enter
   Default output format [None]: Type json here, and then press Enter
   ```

   で使用するプロファイルの作成と設定の詳細については AWS CLI、以下を参照してください。
   + [名前付きプロファイル](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html)
   + [での IAM ロールの使用 AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-role.html)
   + [Set コマンド](https://docs.aws.amazon.com/cli/latest/reference/set.html)
   + [認証情報をローテーションして AWS CodeCommit リポジトリに接続する](temporary-access.md)

   別の のリポジトリまたはリソースに接続するには AWS リージョン、デフォルトのリージョン名 AWS CLI で を再設定する必要があります。CodeCommit でサポートされるデフォルトのリージョン名は以下のとおりです。
   + us-east-2
   + us-east-1
   + eu-west-1
   + us-west-2
   + ap-northeast-1
   + ap-southeast-1
   + ap-southeast-2
   + ap-southeast-3
   + me-central-1
   + eu-central-1
   + ap-northeast-2
   + sa-east-1
   + us-west-1
   + eu-west-2
   + ap-south-1
   + ap-south-1
   + ca-central-1
   + us-gov-west-1
   + us-gov-east-1
   + eu-north-1
   + ap-east-1
   + me-south-1
   + cn-north-1
   + cn-northwest-1
   + eu-south-1
   + ap-northeast-3
   + af-south-1
   + il-central-1

   CodeCommit と の詳細については AWS リージョン、「」を参照してください[リージョンと Git 接続エンドポイント](regions.md)。IAM、アクセスキー、シークレットキーに関する詳細については、[認証情報を取得する方法](https://docs.aws.amazon.com/IAM/latest/UserGuide/IAM_Introduction.html#IAM_SecurityCredentials)および [IAM ユーザーのアクセスキーの管理](https://docs.aws.amazon.com/IAM/latest/UserGuide/ManagingCredentials.html)を参照してください。 AWS CLI および プロファイルの詳細については、[「名前付きプロファイル](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html)」を参照してください。

使用可能なすべての CodeCommit コマンドのリストを表示するには、次のコマンドを実行します。

```
aws codecommit help
```

特定の CodeCommit コマンドに関する情報を表示するには、次のコマンドを実行します。ここで、*command-name* はコマンドの名前です (例: **create-repository**)。

```
aws codecommit command-name help
```

 AWS CLIのコマンドの説明と使用例については、以下を参照してください。
+ [associate-approval-rule-template-with-repository](how-to-associate-template.md#associate-template-repository)
+ [batch-associate-approval-rule-template-with-repositories](how-to-associate-template.md#batch-associate-template-repositories)
+ [batch-disassociate-approval-rule-template-from-repositories](how-to-disassociate-template.md#batch-disassociate-template)
+ [batch-describe-merge-conflicts](how-to-resolve-conflict-pull-request.md#batch-describe-merge-conflicts)
+ [batch-get-commits](how-to-view-commit-details.md#how-to-view-commit-details-cli-batch-get-commits)
+ [batch-get-repositories](how-to-view-repository-details.md#how-to-view-repository-details-with-names-cli)
+ [create-approval-rule-template](how-to-create-template.md#create-template-cli)
+ [create-branch](how-to-create-branch.md#how-to-create-branch-cli)
+ [create-commit](how-to-create-commit.md#how-to-create-commit-cli)
+ [create-pull-request](how-to-create-pull-request.md#how-to-create-pull-request-cli)
+ [create-pull-request-approval-rule](how-to-create-pull-request-approval-rule.md#how-to-create-pull-request-approval-rule-cli)
+ [create-repository](how-to-create-repository.md#how-to-create-repository-cli)
+ [create-unreferenced-merge-commit](how-to-resolve-conflict-pull-request.md#create-unreferenced-merge-commit)
+ [delete-approval-rule-template](how-to-delete-template.md#delete-template)
+ [delete-branch](how-to-delete-branch.md#how-to-delete-branch-cli)
+ [delete-comment-content](how-to-commit-comment.md#how-to-commit-comment-cli-commit-delete)
+ [delete-file](how-to-edit-file.md#how-to-edit-file-cli)
+ [delete-repository](how-to-delete-repository.md#how-to-delete-repository-cli)
+ [describe-merge-conflicts](how-to-resolve-conflict-pull-request.md#describe-merge-conflicts)
+ [delete-pull-request-approval-rule](how-to-edit-delete-pull-request-approval-rule.md#delete-pull-request-approval-rule)
+ [describe-pull-request-events](how-to-view-pull-request.md#describe-pull-request-events)
+ [disassociate-pull-request-approval-rule-template-from-repository](how-to-disassociate-template.md#disassociate-template)
+ [evaluate-pull-request-approval-rules](how-to-merge-pull-request.md#evaluate-pull-request-approval-rules)
+ [get-approval-rule-template](how-to-manage-templates.md#get-template)
+ [get-blob](how-to-view-commit-details.md#how-to-view-commit-details-cli-blob)
+ [get-branch](how-to-view-branch-details.md#how-to-view-branch-details-cli-details)
+ [get-comment](how-to-commit-comment.md#how-to-commit-comment-cli-get-comment-info)
+ [get-comment-reactions](how-to-commit-comment.md#how-to-commit-comment-cli-commit-emoji-view)
+ [get-comments-for-compared-commit](how-to-commit-comment.md#how-to-commit-comment-cli-get-comments)
+ [get-comments-for-pull-request](how-to-review-pull-request.md#get-comments-for-pull-request)
+ [get-commit](how-to-view-commit-details.md#how-to-view-commit-details-cli-commit)
+ [get-differences](how-to-view-commit-details.md#how-to-view-commit-details-cli-differences)
+ [get-merge-commit](how-to-view-commit-details.md#how-to-view-commit-details-cli-merge-commit)
+ [get-merge-conflicts](how-to-view-pull-request.md#get-merge-conflicts)
+ [get-merge-options](how-to-resolve-conflict-pull-request.md#get-merge-options)
+ [get-pull-request](how-to-view-pull-request.md#get-pull-request)
+ [get-pull-request-approval-states](how-to-view-pull-request.md#get-pull-request-approval-state)
+ [get-pull-request-override-state](how-to-override-approval-rules.md#get-override-status)
+ [get-repository](how-to-view-repository-details.md#how-to-view-repository-details-with-name-cli)
+ [get-repository-triggers](how-to-notify-edit.md#how-to-notify-edit-cli)
+ [list-approval-rule-templates](how-to-manage-templates.md#list-templates)
+ [list-associated-approval-rule-templates-for-repository](how-to-manage-templates.md#list-associated-templates)
+ [list-branches](how-to-view-branch-details.md#how-to-view-branch-details-cli)
+ [list-pull-requests](how-to-view-pull-request.md#list-pull-requests)
+ [list-repositories](how-to-view-repository-details.md#how-to-view-repository-details-no-name-cli)
+ [list-repositories-for-approval-rule-template](how-to-manage-templates.md#list-associated-repositories)
+ [list-tags-for-resource](how-to-tag-repository-list.md)
+ [merge-branches-by-fast-forward](how-to-compare-branches.md#merge-branches-by-fast-forward)
+ [merge-branches-by-squash](how-to-compare-branches.md#merge-branches-by-squash)
+ [merge-branches-by-three-way](how-to-compare-branches.md#merge-branches-by-three-way)
+ [merge-pull-request-by-fast-forward](how-to-merge-pull-request.md#merge-pull-request-by-fast-forward)
+ [merge-pull-request-by-squash](how-to-merge-pull-request.md#merge-pull-request-by-squash)
+ [merge-pull-request-by-three-way](how-to-merge-pull-request.md#merge-pull-request-by-three-way)
+ [override-pull-request-approval-rules](how-to-override-approval-rules.md#override-approval-rules)
+ [post-comment-for-compared-commit](how-to-commit-comment.md#how-to-commit-comment-cli-comment)
+ [post-comment-for-pull-request](how-to-review-pull-request.md#post-comment-for-pull-request)
+ [post-comment-reply](how-to-commit-comment.md#how-to-commit-comment-cli-commit-reply)
+ [put-comment-reaction](how-to-commit-comment.md#how-to-commit-comment-cli-commit-reply-emoji)
+ [put-file](how-to-create-file.md#how-to-create-file-cli)
+ [put-repository-triggers](how-to-notify-edit.md#how-to-notify-edit-cli)
+ [tag-resource](how-to-tag-repository-add.md)
+ [test-repository-triggers](how-to-notify-test.md#how-to-notify-test-cli)
+ [untag-resource](how-to-tag-repository-delete.md)
+ [update-approval-rule-template-content](how-to-manage-templates.md#update-template-content)
+ [update-approval-rule-template-description](how-to-manage-templates.md#update-template-description)
+ [update-approval-rule-template-name](how-to-manage-templates.md#update-template-name)
+ [update-comment](how-to-commit-comment.md#how-to-commit-comment-cli-commit-update)
+ [update-default-branch](how-to-change-branch.md#how-to-change-branch-cli-default)
+ [update-pull-request-approval-rule-content](how-to-edit-delete-pull-request-approval-rule.md#update-pull-request-approval-rule-content)
+ [update-pull-request-approval-state](how-to-review-pull-request.md#update-pull-request-approval-state)
+ [update-pull-request-description](how-to-update-pull-request.md#update-pull-request-description)
+ [update-pull-request-status](how-to-close-pull-request.md#update-pull-request-status)
+ [update-pull-request-title](how-to-update-pull-request.md#update-pull-request-title)
+ [update-repository-description](how-to-change-repository.md#how-to-change-repository-cli-description)
+ [update-repository-name](how-to-change-repository.md#how-to-change-repository-cli-name)