

Terjemahan disediakan oleh mesin penerjemah. Jika konten terjemahan yang diberikan bertentangan dengan versi bahasa Inggris aslinya, utamakan versi bahasa Inggris.

# CodeCommit contoh menggunakan AWS CLI
<a name="cli_codecommit_code_examples"></a>

Contoh kode berikut menunjukkan cara melakukan tindakan dan mengimplementasikan skenario umum dengan menggunakan AWS Command Line Interface with CodeCommit.

*Tindakan* merupakan kutipan kode dari program yang lebih besar dan harus dijalankan dalam konteks. Sementara tindakan menunjukkan cara memanggil fungsi layanan individual, Anda dapat melihat tindakan dalam konteks dalam skenario terkait.

Setiap contoh menyertakan tautan ke kode sumber lengkap, di mana Anda dapat menemukan instruksi tentang cara mengatur dan menjalankan kode dalam konteks.

**Topics**
+ [Tindakan](#actions)

## Tindakan
<a name="actions"></a>

### `associate-approval-rule-template-with-repository`
<a name="codecommit_AssociateApprovalRuleTemplateWithRepository_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`associate-approval-rule-template-with-repository`.

**AWS CLI**  
**Untuk mengaitkan template aturan persetujuan dengan repositori**  
`associate-approval-rule-template-with-repository`Contoh berikut mengaitkan template aturan persetujuan yang ditentukan dengan repositori bernama. `MyDemoRepo`  

```
aws codecommit associate-approval-rule-template-with-repository \
    --repository-name MyDemoRepo  \
    --approval-rule-template-name 2-approver-rule-for-main
```
Perintah ini tidak menghasilkan output.  
Untuk informasi selengkapnya, lihat [Mengaitkan Template Aturan Persetujuan dengan Repositori](https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-associate-template.html#associate-template-repository) di *AWS CodeCommit Panduan Pengguna*.  
+  Untuk detail API, lihat [AssociateApprovalRuleTemplateWithRepository](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/associate-approval-rule-template-with-repository.html)di *Referensi AWS CLI Perintah*. 

### `batch-associate-approval-rule-template-with-repositories`
<a name="codecommit_BatchAssociateApprovalRuleTemplateWithRepositories_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`batch-associate-approval-rule-template-with-repositories`.

**AWS CLI**  
**Untuk mengaitkan template aturan persetujuan dengan beberapa repositori dalam satu operasi**  
`batch-associate-approval-rule-template-with-repositories`Contoh berikut mengaitkan template aturan persetujuan yang ditentukan dengan repositori bernama dan. `MyDemoRepo` `MyOtherDemoRepo`  
Catatan: Templat aturan persetujuan khusus untuk AWS Wilayah tempat mereka dibuat. Mereka hanya dapat dikaitkan dengan repositori di Wilayah itu AWS .  

```
aws codecommit batch-associate-approval-rule-template-with-repositories \
    --repository-names MyDemoRepo, MyOtherDemoRepo  \
    --approval-rule-template-name 2-approver-rule-for-main
```
Output:  

```
{
    "associatedRepositoryNames": [
        "MyDemoRepo",
        "MyOtherDemoRepo"
    ],
    "errors": []
}
```
Untuk informasi selengkapnya, lihat [Mengaitkan Template Aturan Persetujuan dengan Repositori](https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-associate-template.html#batch-associate-template-repositories) di *AWS CodeCommit Panduan Pengguna*.  
+  Untuk detail API, lihat [BatchAssociateApprovalRuleTemplateWithRepositories](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/batch-associate-approval-rule-template-with-repositories.html)di *Referensi AWS CLI Perintah*. 

### `batch-describe-merge-conflicts`
<a name="codecommit_BatchDescribeMergeConflicts_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`batch-describe-merge-conflicts`.

**AWS CLI**  
**Untuk mendapatkan informasi tentang konflik gabungan di semua file atau subset file dalam penggabungan antara dua penentu komit**  
`batch-describe-merge-conflicts`Contoh berikut menentukan konflik gabungan untuk menggabungkan cabang sumber bernama `feature-randomizationfeature` dengan cabang tujuan bernama `main` menggunakan `THREE_WAY_MERGE` strategi dalam repositori bernama. `MyDemoRepo`  

```
aws codecommit batch-describe-merge-conflicts \
    --source-commit-specifier feature-randomizationfeature \
    --destination-commit-specifier main \
    --merge-option THREE_WAY_MERGE \
    --repository-name MyDemoRepo
```
Output:  

```
{
    "conflicts": [
        {
            "conflictMetadata": {
                "filePath": "readme.md",
                "fileSizes": {
                    "source": 139,
                    "destination": 230,
                    "base": 85
                },
                "fileModes": {
                    "source": "NORMAL",
                    "destination": "NORMAL",
                    "base": "NORMAL"
                },
                "objectTypes": {
                    "source": "FILE",
                    "destination": "FILE",
                    "base": "FILE"
                },
                "numberOfConflicts": 1,
                "isBinaryFile": {
                    "source": false,
                    "destination": false,
                    "base": false
                },
                "contentConflict": true,
                "fileModeConflict": false,
                "objectTypeConflict": false,
                "mergeOperations": {
                    "source": "M",
                    "destination": "M"
                }
            },
            "mergeHunks": [
                {
                    "isConflict": true,
                    "source": {
                        "startLine": 0,
                        "endLine": 3,
                        "hunkContent": "VGhpcyBpEXAMPLE=="
                    },
                    "destination": {
                        "startLine": 0,
                        "endLine": 1,
                        "hunkContent": "VXNlIHRoEXAMPLE="
                    }
                }
            ]
        }
    ],
    "errors": [],
    "destinationCommitId": "86958e0aEXAMPLE",
    "sourceCommitId": "6ccd57fdEXAMPLE",
    "baseCommitId": "767b6958EXAMPLE"
}
```
Untuk informasi selengkapnya, lihat [Menyelesaikan Konflik dalam Permintaan Tarik](https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-resolve-conflict-pull-request.html#batch-describe-merge-conflicts) di *Panduan AWS CodeCommit Pengguna*.  
+  Untuk detail API, lihat [BatchDescribeMergeConflicts](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/batch-describe-merge-conflicts.html)di *Referensi AWS CLI Perintah*. 

### `batch-disassociate-approval-rule-template-from-repositories`
<a name="codecommit_BatchDisassociateApprovalRuleTemplateFromRepositories_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`batch-disassociate-approval-rule-template-from-repositories`.

**AWS CLI**  
**Untuk memisahkan template aturan persetujuan dari beberapa repositori dalam satu operasi**  
`batch-disassociate-approval-rule-template-from-repositories`Contoh berikut memisahkan template aturan persetujuan yang ditentukan dari repositori bernama dan. `MyDemoRepo` `MyOtherDemoRepo`  

```
aws codecommit batch-disassociate-approval-rule-template-from-repositories \
    --repository-names MyDemoRepo, MyOtherDemoRepo  \
    --approval-rule-template-name 1-approval-rule-for-all pull requests
```
Output:  

```
{
    "disassociatedRepositoryNames": [
        "MyDemoRepo",
        "MyOtherDemoRepo"
    ],
    "errors": []
}
```
Untuk informasi selengkapnya, lihat [Memutuskan Template Aturan Persetujuan](https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-disassociate-template.html#batch-disassociate-template) di *Panduan AWS CodeCommit Pengguna*.  
+  Untuk detail API, lihat [BatchDisassociateApprovalRuleTemplateFromRepositories](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/batch-disassociate-approval-rule-template-from-repositories.html)di *Referensi AWS CLI Perintah*. 

### `batch-get-commits`
<a name="codecommit_BatchGetCommits_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`batch-get-commits`.

**AWS CLI**  
**Untuk melihat informasi tentang beberapa komit**  
`batch-get-commits`Contoh berikut menampilkan rincian tentang commit yang ditentukan.  

```
aws codecommit batch-get-commits  \
    --repository-name MyDemoRepo  \
    --commit-ids 317f8570EXAMPLE 4c925148EXAMPLE
```
Output:  

```
{
    "commits": [
      {
        "additionalData": "",
        "committer": {
            "date": "1508280564 -0800",
            "name": "Mary Major",
            "email": "mary_major@example.com"
        },
        "author": {
            "date": "1508280564 -0800",
            "name": "Mary Major",
            "email": "mary_major@example.com"
        },
        "commitId": "317f8570EXAMPLE",
        "treeId": "1f330709EXAMPLE",
        "parents": [
            "6e147360EXAMPLE"
        ],
        "message": "Change variable name and add new response element"
    },
    {
        "additionalData": "",
        "committer": {
            "date": "1508280542 -0800",
            "name": "Li Juan",
            "email": "li_juan@example.com"
        },
        "author": {
            "date": "1508280542 -0800",
            "name": "Li Juan",
            "email": "li_juan@example.com"
        },
        "commitId": "4c925148EXAMPLE",
        "treeId": "1f330709EXAMPLE",
        "parents": [
            "317f8570EXAMPLE"
        ],
        "message": "Added new class"
    }
}
```
Untuk informasi selengkapnya, lihat [Melihat Detail Komit](https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-view-commit-details.html#how-to-view-commit-details-cli-batch-get-commits) di *Panduan AWS CodeCommit Pengguna*.  
+  Untuk detail API, lihat [BatchGetCommits](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/batch-get-commits.html)di *Referensi AWS CLI Perintah*. 

### `batch-get-repositories`
<a name="codecommit_BatchGetRepositories_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`batch-get-repositories`.

**AWS CLI**  
**Untuk melihat detail tentang beberapa repositori**  
Contoh ini menunjukkan rincian tentang beberapa AWS CodeCommit repositori.  

```
aws codecommit batch-get-repositories \
    --repository-names MyDemoRepo MyOtherDemoRepo
```
Output:  

```
{
    "repositoriesNotFound": [],
    "repositories": [
         {
            "creationDate": 1429203623.625,
            "defaultBranch": "main",
            "repositoryName": "MyDemoRepo",
            "cloneUrlSsh": "ssh://git-codecommit.us-east-2.amazonaws.com/v1/repos/MyDemoRepo",
            "lastModifiedDate": 1430783812.0869999,
            "repositoryDescription": "My demonstration repository",
            "cloneUrlHttp": "https://codecommit.us-east-2.amazonaws.com/v1/repos/MyDemoRepo",
            "repositoryId": "f7579e13-b83e-4027-aaef-650c0EXAMPLE",
            "Arn": "arn:aws:codecommit:us-east-2:111111111111:MyDemoRepo"
            "accountId": "111111111111"
        },
        {
            "creationDate": 1429203623.627,
            "defaultBranch": "main",
            "repositoryName": "MyOtherDemoRepo",
            "cloneUrlSsh": "ssh://git-codecommit.us-east-2.amazonaws.com/v1/repos/MyOtherDemoRepo",
            "lastModifiedDate": 1430783812.0889999,
            "repositoryDescription": "My other demonstration repository",
            "cloneUrlHttp": "https://codecommit.us-east-2.amazonaws.com/v1/repos/MyOtherDemoRepo",
            "repositoryId": "cfc29ac4-b0cb-44dc-9990-f6f51EXAMPLE",
            "Arn": "arn:aws:codecommit:us-east-2:111111111111:MyOtherDemoRepo"
            "accountId": "111111111111"
        }
    ],
    "repositoriesNotFound": []
}
```
+  Untuk detail API, lihat [BatchGetRepositories](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/batch-get-repositories.html)di *Referensi AWS CLI Perintah*. 

### `create-approval-rule-template`
<a name="codecommit_CreateApprovalRuleTemplate_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`create-approval-rule-template`.

**AWS CLI**  
**Untuk membuat templat aturan persetujuan**  
`create-approval-rule-template`Contoh berikut membuat template aturan persetujuan bernama `2-approver-rule-for-main ``. The template requires two users who assume the role of ``CodeCommitReview` untuk menyetujui permintaan tarik sebelum dapat digabungkan ke cabang. `main`  

```
aws codecommit create-approval-rule-template \
    --approval-rule-template-name 2-approver-rule-for-main \
    --approval-rule-template-description  "Requires two developers from the team to approve the pull request if the destination branch is main" \
    --approval-rule-template-content "{\"Version\": \"2018-11-08\",\"DestinationReferences\": [\"refs/heads/main\"],\"Statements\": [{\"Type\": \"Approvers\",\"NumberOfApprovalsNeeded\": 2,\"ApprovalPoolMembers\": [\"arn:aws:sts::123456789012:assumed-role/CodeCommitReview/*\"]}]}"
```
Output:  

```
{
    "approvalRuleTemplate": {
        "approvalRuleTemplateName": "2-approver-rule-for-main",
        "creationDate": 1571356106.936,
        "approvalRuleTemplateId": "dd8b17fe-EXAMPLE",
        "approvalRuleTemplateContent": "{\"Version\": \"2018-11-08\",\"DestinationReferences\": [\"refs/heads/main\"],\"Statements\": [{\"Type\": \"Approvers\",\"NumberOfApprovalsNeeded\": 2,\"ApprovalPoolMembers\": [\"arn:aws:sts::123456789012:assumed-role/CodeCommitReview/*\"]}]}",
        "lastModifiedUser": "arn:aws:iam::123456789012:user/Mary_Major",
        "approvalRuleTemplateDescription": "Requires two developers from the team to approve the pull request if the destination branch is main",
        "lastModifiedDate": 1571356106.936,
        "ruleContentSha256": "4711b576EXAMPLE"
    }
}
```
Untuk informasi selengkapnya, lihat [Membuat Template Aturan Persetujuan](https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-create-template.html#create-template-cli) di *Panduan AWS CodeCommit Pengguna*.  
+  Untuk detail API, lihat [CreateApprovalRuleTemplate](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/create-approval-rule-template.html)di *Referensi AWS CLI Perintah*. 

### `create-branch`
<a name="codecommit_CreateBranch_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`create-branch`.

**AWS CLI**  
**Untuk membuat cabang**  
Contoh ini membuat cabang dalam AWS CodeCommit repositori. Perintah ini menghasilkan output hanya jika ada kesalahan.  
Perintah:  

```
aws codecommit create-branch --repository-name MyDemoRepo --branch-name MyNewBranch --commit-id 317f8570EXAMPLE
```
Output:  

```
None.
```
+  Untuk detail API, lihat [CreateBranch](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/create-branch.html)di *Referensi AWS CLI Perintah*. 

### `create-commit`
<a name="codecommit_CreateCommit_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`create-commit`.

**AWS CLI**  
**Untuk membuat komit**  
`create-commit`Contoh berikut menunjukkan cara membuat komit awal untuk repositori yang menambahkan `readme.md` file ke repositori bernama di cabang. `MyDemoRepo` `main`  

```
aws codecommit create-commit \
    --repository-name MyDemoRepo \
    --branch-name main \
    --put-files "filePath=readme.md,fileContent='Welcome to our team repository.'"
```
Output:  

```
{
    "filesAdded": [
        {
            "blobId": "5e1c309d-EXAMPLE",
            "absolutePath": "readme.md",
            "fileMode": "NORMAL"
        }
    ],
    "commitId": "4df8b524-EXAMPLE",
    "treeId": "55b57003-EXAMPLE",
    "filesDeleted": [],
    "filesUpdated": []
}
```
Untuk informasi selengkapnya, lihat [Membuat Komit AWS CodeCommit di](https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-create-commit.html#how-to-create-commit-cli) *Panduan AWS CodeCommit Pengguna*.  
+  Untuk detail API, lihat [CreateCommit](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/create-commit.html)di *Referensi AWS CLI Perintah*. 

### `create-pull-request-approval-rule`
<a name="codecommit_CreatePullRequestApprovalRule_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`create-pull-request-approval-rule`.

**AWS CLI**  
**Untuk membuat aturan persetujuan untuk permintaan tarik**  
`create-pull-request-approval-rule`Contoh berikut membuat aturan persetujuan bernama `Require two approved approvers` untuk permintaan tarik tertentu. Aturan menetapkan bahwa dua persetujuan diperlukan dari kumpulan persetujuan. Pool mencakup semua pengguna yang mengakses CodeCommit dengan mengambil peran `CodeCommitReview` dalam `123456789012` AWS akun. Ini juga mencakup pengguna IAM atau pengguna federasi bernama `Nikhil_Jayashankar` dari akun yang sama AWS .  

```
aws codecommit create-pull-request-approval-rule  \
    --approval-rule-name "Require two approved approvers"  \
    --approval-rule-content "{\"Version\": \"2018-11-08\",\"Statements\": [{\"Type\": \"Approvers\",\"NumberOfApprovalsNeeded\": 2,\"ApprovalPoolMembers\": [\"CodeCommitApprovers:123456789012:Nikhil_Jayashankar\", \"arn:aws:sts::123456789012:assumed-role/CodeCommitReview/*\"]}]}"
```
Output:  

```
{
    "approvalRule": {
        "approvalRuleName": "Require two approved approvers",
        "lastModifiedDate": 1570752871.932,
        "ruleContentSha256": "7c44e6ebEXAMPLE",
        "creationDate": 1570752871.932,
        "approvalRuleId": "aac33506-EXAMPLE",
        "approvalRuleContent": "{\"Version\": \"2018-11-08\",\"Statements\": [{\"Type\": \"Approvers\",\"NumberOfApprovalsNeeded\": 2,\"ApprovalPoolMembers\": [\"CodeCommitApprovers:123456789012:Nikhil_Jayashankar\", \"arn:aws:sts::123456789012:assumed-role/CodeCommitReview/*\"]}]}",
        "lastModifiedUser": "arn:aws:iam::123456789012:user/Mary_Major"
    }
}
```
Untuk informasi selengkapnya, lihat [Membuat Aturan Persetujuan](https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-create-pull-request-approval-rule.html#how-to-create-pull-request-approval-rule-cli) di *Panduan AWS CodeCommit Pengguna*.  
+  Untuk detail API, lihat [CreatePullRequestApprovalRule](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/create-pull-request-approval-rule.html)di *Referensi AWS CLI Perintah*. 

### `create-pull-request`
<a name="codecommit_CreatePullRequest_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`create-pull-request`.

**AWS CLI**  
**Untuk membuat permintaan tarik**  
`create-pull-request`Contoh berikut membuat permintaan tarik bernama 'Penganalisis kesulitan pengucapan' dengan deskripsi 'Harap tinjau perubahan ini pada hari Selasa' yang menargetkan cabang sumber 'jane-branch' dan akan digabungkan ke cabang default 'main' di repositori bernama ''. AWS CodeCommit MyDemoRepo  

```
aws codecommit create-pull-request \
    --title "My Pull Request" \
    --description "Please review these changes by Tuesday" \
    --client-request-token 123Example \
    --targets repositoryName=MyDemoRepo,sourceReference=MyNewBranch
```
Output:  

```
{
    "pullRequest": {
        "approvalRules": [
            {
                "approvalRuleContent": "{\"Version\": \"2018-11-08\",\"DestinationReferences\": [\"refs/heads/main\"],\"Statements\": [{\"Type\": \"Approvers\",\"NumberOfApprovalsNeeded\": 2,\"ApprovalPoolMembers\": [\"arn:aws:sts::123456789012:assumed-role/CodeCommitReview/*\"]}]}",
                "approvalRuleId": "dd8b17fe-EXAMPLE",
                "approvalRuleName": "2-approver-rule-for-main",
                "creationDate": 1571356106.936,
                "lastModifiedDate": 571356106.936,
                "lastModifiedUser": "arn:aws:iam::123456789012:user/Mary_Major",
                "originApprovalRuleTemplate": {
                    "approvalRuleTemplateId": "dd3d22fe-EXAMPLE",
                    "approvalRuleTemplateName": "2-approver-rule-for-main"
                },
                "ruleContentSha256": "4711b576EXAMPLE"
            }
        ],
        "authorArn": "arn:aws:iam::111111111111:user/Jane_Doe",
        "description": "Please review these changes by Tuesday",
        "title": "Pronunciation difficulty analyzer",
        "pullRequestTargets": [
            {
                "destinationCommit": "5d036259EXAMPLE",
                "destinationReference": "refs/heads/main",
                "repositoryName": "MyDemoRepo",
                "sourceCommit": "317f8570EXAMPLE",
                "sourceReference": "refs/heads/jane-branch",
                "mergeMetadata": {
                    "isMerged": false
                }
            }
        ],
        "lastActivityDate": 1508962823.285,
        "pullRequestId": "42",
        "clientRequestToken": "123Example",
        "pullRequestStatus": "OPEN",
        "creationDate": 1508962823.285
    }
}
```
+  Untuk detail API, lihat [CreatePullRequest](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/create-pull-request.html)di *Referensi AWS CLI Perintah*. 

### `create-repository`
<a name="codecommit_CreateRepository_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`create-repository`.

**AWS CLI**  
**Untuk membuat repositori**  
Contoh ini membuat repositori dan mengaitkannya dengan akun pengguna. AWS   
Perintah:  

```
aws codecommit create-repository --repository-name MyDemoRepo --repository-description "My demonstration repository"
```
Output:  

```
{
    "repositoryMetadata": {
        "repositoryName": "MyDemoRepo",
                "cloneUrlSsh": "ssh://git-codecommit.us-east-1.amazonaws.com/v1/repos/MyDemoRepo",
                "lastModifiedDate": 1444766838.027,
        "repositoryDescription": "My demonstration repository",
                "cloneUrlHttp": "https://git-codecommit.us-east-1.amazonaws.com/v1/repos/MyDemoRepo",
        "repositoryId": "f7579e13-b83e-4027-aaef-650c0EXAMPLE",
                "Arn": "arn:aws:codecommit:us-east-1:111111111111EXAMPLE:MyDemoRepo",
        "accountId": "111111111111"
    }
}
```
+  Untuk detail API, lihat [CreateRepository](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/create-repository.html)di *Referensi AWS CLI Perintah*. 

### `create-unreferenced-merge-commit`
<a name="codecommit_CreateUnreferencedMergeCommit_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`create-unreferenced-merge-commit`.

**AWS CLI**  
**Untuk membuat komit yang tidak direferensikan yang mewakili hasil penggabungan dua penentu komit**  
`create-unreferenced-merge-commit`Contoh berikut membuat komit yang mewakili hasil penggabungan antara cabang sumber bernama `bugfix-1234` dengan cabang tujuan bernama `main` menggunakan strategi THREE\$1WAY\$1MERGE dalam repositori bernama. `MyDemoRepo`  

```
aws codecommit create-unreferenced-merge-commit \
    --source-commit-specifier bugfix-1234 \
    --destination-commit-specifier main \
    --merge-option THREE_WAY_MERGE \
    --repository-name MyDemoRepo \
    --name "Maria Garcia" \
    --email "maria_garcia@example.com" \
    --commit-message "Testing the results of this merge."
```
Output:  

```
{
    "commitId": "4f178133EXAMPLE",
    "treeId": "389765daEXAMPLE"
}
```
Untuk informasi selengkapnya, lihat [Menyelesaikan Konflik dalam Permintaan Tarik](https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-resolve-conflict-pull-request.html#batch-describe-merge-conflicts) di *Panduan AWS CodeCommit Pengguna*.  
+  Untuk detail API, lihat [CreateUnreferencedMergeCommit](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/create-unreferenced-merge-commit.html)di *Referensi AWS CLI Perintah*. 

### `credential-helper`
<a name="codecommit_CredentialHelper_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`credential-helper`.

**AWS CLI**  
**Untuk mengatur pembantu kredensyal yang termasuk dalam CLI AWS dengan AWS CodeCommit**  
`credential-helper`Utilitas tidak dirancang untuk dipanggil langsung dari AWS CLI. Sebaliknya itu dimaksudkan untuk digunakan sebagai parameter dengan `git config` perintah untuk mengatur komputer lokal Anda. Ini memungkinkan Git untuk menggunakan HTTPS dan versi yang ditandatangani secara kriptografis dari kredensyal pengguna IAM Anda atau peran instans Amazon EC2 setiap kali Git perlu mengautentikasi untuk berinteraksi dengan repositori. AWS CodeCommit   

```
git config --global credential.helper '!aws codecommit credential-helper $@'
git config --global credential.UseHttpPath true
```
Output:  

```
[credential]
    helper = !aws codecommit credential-helper $@
    UseHttpPath = true
```
Untuk informasi selengkapnya, lihat Menyiapkan untuk AWS CodeCommit Menggunakan Metode Lain di *Panduan AWS CodeCommit Pengguna*. *Tinjau konten dengan seksama, lalu ikuti prosedur di salah satu topik berikut: Untuk Koneksi HTTPS di Linux, macOS, atau Unix atau Untuk Koneksi HTTPS di Windows di Panduan Pengguna.AWS CodeCommit *  
+  Untuk detail API, lihat [CredentialHelper](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/credential-helper.html)di *Referensi AWS CLI Perintah*. 

### `delete-approval-rule-template`
<a name="codecommit_DeleteApprovalRuleTemplate_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`delete-approval-rule-template`.

**AWS CLI**  
**Untuk menghapus templat aturan persetujuan**  
`delete-approval-rule-template`Contoh berikut menghapus template aturan persetujuan yang ditentukan.  

```
aws codecommit delete-approval-rule-template  \
    --approval-rule-template-name 1-approver-for-all-pull-requests
```
Output:  

```
{
    "approvalRuleTemplateId": "41de97b7-EXAMPLE"
}
```
Untuk informasi selengkapnya, lihat [Menghapus Template Aturan Persetujuan](https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-delete-template.html#delete-template) di *Panduan AWS CodeCommit Pengguna*.  
+  Untuk detail API, lihat [DeleteApprovalRuleTemplate](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/delete-approval-rule-template.html)di *Referensi AWS CLI Perintah*. 

### `delete-branch`
<a name="codecommit_DeleteBranch_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`delete-branch`.

**AWS CLI**  
**Untuk menghapus cabang**  
Contoh ini menunjukkan cara menghapus cabang di AWS CodeCommit repositori.  
Perintah:  

```
aws codecommit delete-branch --repository-name MyDemoRepo --branch-name MyNewBranch
```
Output:  

```
{
  "branch": {
      "commitId": "317f8570EXAMPLE",
      "branchName": "MyNewBranch"
  }
}
```
+  Untuk detail API, lihat [DeleteBranch](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/delete-branch.html)di *Referensi AWS CLI Perintah*. 

### `delete-comment-content`
<a name="codecommit_DeleteCommentContent_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`delete-comment-content`.

**AWS CLI**  
**Untuk menghapus konten komentar**  
Anda hanya dapat menghapus konten komentar jika Anda membuat komentar. Contoh ini menunjukkan cara menghapus konten komentar dengan ID yang dihasilkan sistem dari. `ff30b348EXAMPLEb9aa670f`  

```
aws codecommit delete-comment-content \
    --comment-id ff30b348EXAMPLEb9aa670f
```
Output:  

```
{
    "comment": {
        "creationDate": 1508369768.142,
        "deleted": true,
        "lastModifiedDate": 1508369842.278,
        "clientRequestToken": "123Example",
        "commentId": "ff30b348EXAMPLEb9aa670f",
        "authorArn": "arn:aws:iam::111111111111:user/Li_Juan",
        "callerReactions": [],
        "reactionCounts":
        {
            "CLAP" : 1
        }
    }
}
```
+  Untuk detail API, lihat [DeleteCommentContent](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/delete-comment-content.html)di *Referensi AWS CLI Perintah*. 

### `delete-file`
<a name="codecommit_DeleteFile_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`delete-file`.

**AWS CLI**  
**Untuk menghapus file**  
`delete-file`Contoh berikut menunjukkan cara menghapus file bernama `README.md` dari cabang bernama `main` dengan ID komit terbaru dari `c5709475EXAMPLE` dalam repositori bernama. `MyDemoRepo`  

```
aws codecommit delete-file \
    --repository-name MyDemoRepo \
    --branch-name main \
    --file-path README.md \
    --parent-commit-id c5709475EXAMPLE
```
Output:  

```
{
    "blobId":"559b44fEXAMPLE",
    "commitId":"353cf655EXAMPLE",
    "filePath":"README.md",
    "treeId":"6bc824cEXAMPLE"
}
```
Untuk informasi selengkapnya, lihat [Mengedit atau Menghapus File AWS CodeCommit dalam](https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-edit-file.html?shortFooter=true#how-to-edit-file-cli) panduan *Referensi AWS CodeCommit API*.  
+  Untuk detail API, lihat [DeleteFile](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/delete-file.html)di *Referensi AWS CLI Perintah*. 

### `delete-pull-request-approval-rule`
<a name="codecommit_DeletePullRequestApprovalRule_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`delete-pull-request-approval-rule`.

**AWS CLI**  
**Untuk menghapus aturan persetujuan untuk permintaan tarik**  
`delete-pull-request-approval-rule`Contoh berikut menghapus aturan persetujuan yang dinamai `My Approval Rule` untuk permintaan tarik yang ditentukan.  

```
aws codecommit delete-pull-request-approval-rule  \
    --approval-rule-name "My Approval Rule"  \
    --pull-request-id 15
```
Output:  

```
{
    "approvalRuleId": "077d8e8a8-EXAMPLE"
}
```
Untuk informasi selengkapnya, lihat [Mengedit atau Menghapus Aturan Persetujuan](https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-edit-delete-pull-request-approval-rule.html#delete-pull-request-approval-rule) di *Panduan AWS CodeCommit Pengguna*.  
+  Untuk detail API, lihat [DeletePullRequestApprovalRule](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/delete-pull-request-approval-rule.html)di *Referensi AWS CLI Perintah*. 

### `delete-repository`
<a name="codecommit_DeleteRepository_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`delete-repository`.

**AWS CLI**  
**Untuk menghapus repositori**  
Contoh ini menunjukkan cara menghapus AWS CodeCommit repositori.  
Perintah:  

```
aws codecommit delete-repository --repository-name MyDemoRepo
```
Output:  

```
{
  "repositoryId": "f7579e13-b83e-4027-aaef-650c0EXAMPLE"
}
```
+  Untuk detail API, lihat [DeleteRepository](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/delete-repository.html)di *Referensi AWS CLI Perintah*. 

### `describe-merge-conflicts`
<a name="codecommit_DescribeMergeConflicts_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`describe-merge-conflicts`.

**AWS CLI**  
**Untuk mendapatkan informasi rinci tentang konflik gabungan**  
`describe-merge-conflicts`Contoh berikut menentukan konflik gabungan untuk file bernama `readme.md` di cabang sumber tertentu dan cabang tujuan menggunakan strategi THREE\$1WAY\$1MERGE.  

```
aws codecommit describe-merge-conflicts \
    --source-commit-specifier feature-randomizationfeature \
    --destination-commit-specifier main \
    --merge-option THREE_WAY_MERGE \
    --file-path readme.md \
    --repository-name MyDemoRepo
```
Output:  

```
{
    "conflictMetadata": {
        "filePath": "readme.md",
        "fileSizes": {
            "source": 139,
            "destination": 230,
            "base": 85
        },
        "fileModes": {
            "source": "NORMAL",
            "destination": "NORMAL",
            "base": "NORMAL"
        },
        "objectTypes": {
            "source": "FILE",
            "destination": "FILE",
            "base": "FILE"
        },
        "numberOfConflicts": 1,
        "isBinaryFile": {
            "source": false,
            "destination": false,
            "base": false
        },
        "contentConflict": true,
        "fileModeConflict": false,
        "objectTypeConflict": false,
        "mergeOperations": {
            "source": "M",
            "destination": "M"
        }
    },
    "mergeHunks": [
        {
            "isConflict": true,
            "source": {
                "startLine": 0,
                "endLine": 3,
                "hunkContent": "VGhpcyBpEXAMPLE="
            },
            "destination": {
                "startLine": 0,
                "endLine": 1,
                "hunkContent": "VXNlIHRoEXAMPLE="
            }
        }
    ],
    "destinationCommitId": "86958e0aEXAMPLE",
    "sourceCommitId": "6ccd57fdEXAMPLE",
    "baseCommitId": "767b69580EXAMPLE"
}
```
Untuk informasi selengkapnya, lihat [Menyelesaikan Konflik dalam Permintaan Tarik](https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-resolve-conflict-pull-request.html#describe-merge-conflicts) di *Panduan AWS CodeCommit Pengguna*.  
+  Untuk detail API, lihat [DescribeMergeConflicts](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/describe-merge-conflicts.html)di *Referensi AWS CLI Perintah*. 

### `describe-pull-request-events`
<a name="codecommit_DescribePullRequestEvents_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`describe-pull-request-events`.

**AWS CLI**  
**Untuk melihat peristiwa dalam permintaan tarik**  
`describe-pull-request-events`Contoh berikut mengambil peristiwa untuk permintaan tarik dengan ID '8'.  

```
aws codecommit describe-pull-request-events --pull-request-id 8
```
Output:  

```
{
    "pullRequestEvents": [
        {
            "pullRequestId": "8",
            "pullRequestEventType": "PULL_REQUEST_CREATED",
            "eventDate": 1510341779.53,
            "actor": "arn:aws:iam::111111111111:user/Zhang_Wei"
        },
        {
            "pullRequestStatusChangedEventMetadata": {
                "pullRequestStatus": "CLOSED"
            },
            "pullRequestId": "8",
            "pullRequestEventType": "PULL_REQUEST_STATUS_CHANGED",
            "eventDate": 1510341930.72,
            "actor": "arn:aws:iam::111111111111:user/Jane_Doe"
        }
    ]
}
```
+  Untuk detail API, lihat [DescribePullRequestEvents](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/describe-pull-request-events.html)di *Referensi AWS CLI Perintah*. 

### `disassociate-approval-rule-template-from-repository`
<a name="codecommit_DisassociateApprovalRuleTemplateFromRepository_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`disassociate-approval-rule-template-from-repository`.

**AWS CLI**  
**Untuk memisahkan template aturan persetujuan dari repositori**  
`disassociate-approval-rule-template-from-repository`Contoh berikut memisahkan template aturan persetujuan yang ditentukan dari repositori bernama. `MyDemoRepo`  

```
aws codecommit disassociate-approval-rule-template-from-repository \
    --repository-name MyDemoRepo  \
    --approval-rule-template-name 1-approver-rule-for-all-pull-requests
```
Perintah ini tidak menghasilkan output.  
Untuk informasi selengkapnya, lihat [Memutuskan Template Aturan Persetujuan](https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-disassociate-template.html#disassociate-template) di *Panduan AWS CodeCommit Pengguna*.  
+  Untuk detail API, lihat [DisassociateApprovalRuleTemplateFromRepository](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/disassociate-approval-rule-template-from-repository.html)di *Referensi AWS CLI Perintah*. 

### `evaluate-pull-request-approval-rules`
<a name="codecommit_EvaluatePullRequestApprovalRules_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`evaluate-pull-request-approval-rules`.

**AWS CLI**  
**Untuk mengevaluasi apakah permintaan tarik telah memenuhi semua aturan persetujuannya**  
`evaluate-pull-request-approval-rules`Contoh berikut mengevaluasi status aturan persetujuan pada permintaan tarik yang ditentukan. Dalam contoh ini, aturan persetujuan belum dipenuhi untuk permintaan tarik, sehingga output dari perintah menunjukkan `approved` nilai`false`.  

```
aws codecommit evaluate-pull-request-approval-rules \
    --pull-request-id 27  \
    --revision-id 9f29d167EXAMPLE
```
Output:  

```
{
    "evaluation": {
        "approved": false,
        "approvalRulesNotSatisfied": [
            "Require two approved approvers"
        ],
        "overridden": false,
        "approvalRulesSatisfied": []
    }
}
```
Untuk informasi selengkapnya, lihat [Menggabungkan Permintaan Tarik](https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-merge-pull-request.html#evaluate-pull-request-approval-rules) di *Panduan AWS CodeCommit Pengguna*.  
+  Untuk detail API, lihat [EvaluatePullRequestApprovalRules](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/evaluate-pull-request-approval-rules.html)di *Referensi AWS CLI Perintah*. 

### `get-approval-rule-template`
<a name="codecommit_GetApprovalRuleTemplate_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`get-approval-rule-template`.

**AWS CLI**  
**Untuk mendapatkan konten template aturan persetujuan**  
`get-approval-rule-template`Contoh berikut mendapatkan isi dari template aturan persetujuan bernama`1-approver-rule-for-all-pull-requests`.  

```
aws codecommit get-approval-rule-template \
    --approval-rule-template-name 1-approver-rule-for-all-pull-requests
```
Output:  

```
{
    "approvalRuleTemplate": {
        "approvalRuleTemplateContent": "{\"Version\": \"2018-11-08\",\"Statements\": [{\"Type\": \"Approvers\",\"NumberOfApprovalsNeeded\": 1,\"ApprovalPoolMembers\": [\"arn:aws:sts::123456789012:assumed-role/CodeCommitReview/*\"]}]}",
        "ruleContentSha256": "621181bbEXAMPLE",
        "lastModifiedDate": 1571356106.936,
        "creationDate": 1571356106.936,
        "approvalRuleTemplateName": "1-approver-rule-for-all-pull-requests",
        "lastModifiedUser": "arn:aws:iam::123456789012:user/Li_Juan",
        "approvalRuleTemplateId": "a29abb15-EXAMPLE",
        "approvalRuleTemplateDescription": "All pull requests must be approved by one developer on the team."
    }
}
```
Untuk informasi selengkapnya, lihat [Mengelola Template Aturan Persetujuan](https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-manage-templates.html#get-template) di *Panduan AWS CodeCommit Pengguna*.  
+  Untuk detail API, lihat [GetApprovalRuleTemplate](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/get-approval-rule-template.html)di *Referensi AWS CLI Perintah*. 

### `get-blob`
<a name="codecommit_GetBlob_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`get-blob`.

**AWS CLI**  
**Untuk melihat informasi tentang objek gumpalan Git**  
`get-blob`Contoh berikut mengambil informasi tentang gumpalan Git dengan ID '2eb4AF3BEXample' dalam repositori bernama ''. AWS CodeCommit MyDemoRepo  

```
aws codecommit get-blob  --repository-name MyDemoRepo  --blob-id 2eb4af3bEXAMPLE
```
Output:  

```
{
    "content": "QSBCaW5hcnkgTGFyToEXAMPLE="
}
```
+  Untuk detail API, lihat [GetBlob](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/get-blob.html)di *Referensi AWS CLI Perintah*. 

### `get-branch`
<a name="codecommit_GetBranch_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`get-branch`.

**AWS CLI**  
**Untuk mendapatkan informasi tentang cabang**  
Contoh ini mendapatkan informasi tentang cabang dalam AWS CodeCommit repositori.  
Perintah:  

```
aws codecommit get-branch --repository-name MyDemoRepo --branch-name MyNewBranch
```
Output:  

```
{
  "BranchInfo": {
        "commitID": "317f8570EXAMPLE",
                "branchName": "MyNewBranch"
  }
}
```
+  Untuk detail API, lihat [GetBranch](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/get-branch.html)di *Referensi AWS CLI Perintah*. 

### `get-comment-reactions`
<a name="codecommit_GetCommentReactions_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`get-comment-reactions`.

**AWS CLI**  
**Untuk melihat reaksi emoji terhadap komentar**  
`get-comment-reactions`Contoh berikut mencantumkan semua reaksi emoji terhadap komentar dengan ID dari`abcd1234EXAMPLEb5678efgh`. Jika font untuk shell Anda mendukung tampilan Emoji Versi 1.0, maka dalam output untuk `emoji` emoji ditampilkan.  

```
aws codecommit get-comment-reactions \
    --comment-id abcd1234EXAMPLEb5678efgh
```
Output:  

```
{
    "reactionsForComment": {
        [
           {
               "reaction": {
                    "emoji:"??",
                    "shortCode": "thumbsup",
                    "unicode": "U+1F44D"
                },
                "users": [
                    "arn:aws:iam::123456789012:user/Li_Juan",
                    "arn:aws:iam::123456789012:user/Mary_Major",
                    "arn:aws:iam::123456789012:user/Jorge_Souza"
                ]
            },
            {
                "reaction": {
                    "emoji": "??",
                    "shortCode": "thumbsdown",
                    "unicode": "U+1F44E"
                },
                "users": [
                    "arn:aws:iam::123456789012:user/Nikhil_Jayashankar"
                ]
            },
            {
                "reaction": {
                    "emoji": "??",
                    "shortCode": "confused",
                    "unicode": "U+1F615"
                },
                "users": [
                    "arn:aws:iam::123456789012:user/Saanvi_Sarkar"
                ]
            }
        ]
    }
}
```
Untuk informasi selengkapnya, lihat [Mengomentari komit AWS CodeCommit di](https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-commit-comment.html#how-to-commit-comment-cli-commit-emoji-view) *Panduan AWS CodeCommit Pengguna*.  
+  Untuk detail API, lihat [GetCommentReactions](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/get-comment-reactions.html)di *Referensi AWS CLI Perintah*. 

### `get-comment`
<a name="codecommit_GetComment_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`get-comment`.

**AWS CLI**  
**Untuk melihat detail komentar**  
Contoh ini menunjukkan cara melihat detail komentar dengan ID komentar yang dihasilkan sistem dari. `ff30b348EXAMPLEb9aa670f`  

```
aws codecommit get-comment \
    --comment-id ff30b348EXAMPLEb9aa670f
```
Output:  

```
{
    "comment": {
        "authorArn": "arn:aws:iam::111111111111:user/Li_Juan",
        "clientRequestToken": "123Example",
        "commentId": "ff30b348EXAMPLEb9aa670f",
        "content": "Whoops - I meant to add this comment to the line, but I don't see how to delete it.",
        "creationDate": 1508369768.142,
        "deleted": false,
        "commentId": "",
        "lastModifiedDate": 1508369842.278,
        "callerReactions": [],
        "reactionCounts":
        {
            "SMILE" : 6,
            "THUMBSUP" : 1
        }
    }
}
```
+  Untuk detail API, lihat [GetComment](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/get-comment.html)di *Referensi AWS CLI Perintah*. 

### `get-comments-for-compared-commit`
<a name="codecommit_GetCommentsForComparedCommit_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`get-comments-for-compared-commit`.

**AWS CLI**  
**Untuk melihat komentar pada komit**  
Contoh ini menunjukkan cara melihat komentar yang dibuat pada perbandingan antara dua komit dalam repositori bernama. `MyDemoRepo`  

```
aws codecommit get-comments-for-compared-commit \
    --repository-name MyDemoRepo \
    --before-commit-ID 6e147360EXAMPLE \
    --after-commit-id 317f8570EXAMPLE
```
Output:  

```
{
    "commentsForComparedCommitData": [
        {
            "afterBlobId": "1f330709EXAMPLE",
            "afterCommitId": "317f8570EXAMPLE",
            "beforeBlobId": "80906a4cEXAMPLE",
            "beforeCommitId": "6e147360EXAMPLE",
            "comments": [
                {
                    "authorArn": "arn:aws:iam::111111111111:user/Li_Juan",
                    "clientRequestToken": "123Example",
                    "commentId": "ff30b348EXAMPLEb9aa670f",
                    "content": "Whoops - I meant to add this comment to the line, not the file, but I don't see how to delete it.",
                    "creationDate": 1508369768.142,
                    "deleted": false,
                    "CommentId": "123abc-EXAMPLE",
                    "lastModifiedDate": 1508369842.278,
                    "callerReactions": [],
                    "reactionCounts":
                    {
                        "SMILE" : 6,
                        "THUMBSUP" : 1
                    }
                },
                {
                    "authorArn": "arn:aws:iam::111111111111:user/Li_Juan",
                    "clientRequestToken": "123Example",
                    "commentId": "553b509bEXAMPLE56198325",
                    "content": "Can you add a test case for this?",
                    "creationDate": 1508369612.240,
                    "deleted": false,
                    "commentId": "456def-EXAMPLE",
                    "lastModifiedDate": 1508369612.240,
                    "callerReactions": [],
                    "reactionCounts":
                    {
                        "THUMBSUP" : 2
                    }
                }
            ],
            "location": {
                "filePath": "cl_sample.js",
                "filePosition": 1232,
                "relativeFileVersion": "after"
            },
            "repositoryName": "MyDemoRepo"
        }
    ],
    "nextToken": "exampleToken"
}
```
+  Untuk detail API, lihat [GetCommentsForComparedCommit](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/get-comments-for-compared-commit.html)di *Referensi AWS CLI Perintah*. 

### `get-comments-for-pull-request`
<a name="codecommit_GetCommentsForPullRequest_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`get-comments-for-pull-request`.

**AWS CLI**  
**Untuk melihat komentar untuk permintaan tarik**  
Contoh ini menunjukkan cara melihat komentar untuk permintaan tarik dalam repositori bernama. `MyDemoRepo`  

```
aws codecommit get-comments-for-pull-request \
    --repository-name MyDemoRepo \
    --before-commit-ID 317f8570EXAMPLE \
    --after-commit-id 5d036259EXAMPLE
```
Output:  

```
{
    "commentsForPullRequestData": [
        {
            "afterBlobId": "1f330709EXAMPLE",
            "afterCommitId": "5d036259EXAMPLE",
            "beforeBlobId": "80906a4cEXAMPLE",
            "beforeCommitId": "317f8570EXAMPLE",
            "comments": [
                {
                    "authorArn": "arn:aws:iam::111111111111:user/Saanvi_Sarkar",
                    "clientRequestToken": "",
                    "commentId": "abcd1234EXAMPLEb5678efgh",
                    "content": "These don't appear to be used anywhere. Can we remove them?",
                    "creationDate": 1508369622.123,
                    "deleted": false,
                    "lastModifiedDate": 1508369622.123,
                    "callerReactions": [],
                    "reactionCounts":
                    {
                        "THUMBSUP" : 6,
                        "CONFUSED" : 1
                    }
                },
                {
                    "authorArn": "arn:aws:iam::111111111111:user/Li_Juan",
                    "clientRequestToken": "",
                    "commentId": "442b498bEXAMPLE5756813",
                    "content": "Good catch. I'll remove them.",
                    "creationDate": 1508369829.104,
                    "deleted": false,
                    "lastModifiedDate": 150836912.273,
                    "callerReactions": ["THUMBSUP"]
                    "reactionCounts":
                    {
                        "THUMBSUP" : 14
                    }
                }
            ],
            "location": {
                "filePath": "ahs_count.py",
                "filePosition": 367,
                "relativeFileVersion": "AFTER"
            },
            "repositoryName": "MyDemoRepo",
            "pullRequestId": "42"
        }
    ],
    "nextToken": "exampleToken"
}
```
+  Untuk detail API, lihat [GetCommentsForPullRequest](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/get-comments-for-pull-request.html)di *Referensi AWS CLI Perintah*. 

### `get-commit`
<a name="codecommit_GetCommit_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`get-commit`.

**AWS CLI**  
**Untuk melihat informasi tentang komit dalam repositori**  
Contoh ini menunjukkan detail tentang komit dengan ID yang dihasilkan sistem '7e9fd3091thisisanexamplethisisanexample1 7e9fd3091thisisanexamplethisisanexample1' dalam repositori bernama ''. AWS CodeCommit MyDemoRepo  
Perintah:  

```
aws codecommit get-commit --repository-name MyDemoRepo --commit-id 7e9fd3091thisisanexamplethisisanexample1
```
Output:  

```
{
  "commit": {
      "additionalData": "",
      "committer": {
          "date": "1484167798 -0800",
          "name": "Mary Major",
          "email": "mary_major@example.com"
      },
      "author": {
          "date": "1484167798 -0800",
          "name": "Mary Major",
          "email": "mary_major@example.com"
      },
      "treeId": "347a3408thisisanexampletreeidexample",
      "parents": [
          "7aa87a031thisisanexamplethisisanexample1"
      ],
      "message": "Fix incorrect variable name"
  }
}
```
+  Untuk detail API, lihat [GetCommit](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/get-commit.html)di *Referensi AWS CLI Perintah*. 

### `get-differences`
<a name="codecommit_GetDifferences_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`get-differences`.

**AWS CLI**  
**Untuk mendapatkan informasi tentang perbedaan untuk specifier komit dalam repositori**  
Contoh ini menunjukkan tampilan informasi metadata tentang perubahan antara dua penentu komit (cabang, tag, HEAD, atau referensi lain yang memenuhi syarat sepenuhnya, seperti komit IDs) dalam folder yang diganti namanya dalam repositori bernama. AWS CodeCommit MyDemoRepo Contoh ini mencakup beberapa opsi yang tidak diperlukan, termasuk --before-commit-specifier, --before-path, dan --after-path, untuk lebih menggambarkan bagaimana Anda dapat menggunakan opsi ini untuk membatasi hasil. Respons termasuk izin mode file.  
Perintah:  

```
aws codecommit get-differences --repository-name MyDemoRepo --before-commit-specifier 955bba12thisisanexamplethisisanexample --after-commit-specifier 14a95463thisisanexamplethisisanexample --before-path tmp/example-folder --after-path tmp/renamed-folder
```
Output:  

```
{
  "differences": [
      {
          "afterBlob": {
              "path": "blob.txt",
              "blobId": "2eb4af3b1thisisanexamplethisisanexample1",
              "mode": "100644"
          },
          "changeType": "M",
          "beforeBlob": {
              "path": "blob.txt",
              "blobId": "bf7fcf281thisisanexamplethisisanexample1",
              "mode": "100644"
          }
      }
  ]
}
```
+  Untuk detail API, lihat [GetDifferences](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/get-differences.html)di *Referensi AWS CLI Perintah*. 

### `get-file`
<a name="codecommit_GetFile_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`get-file`.

**AWS CLI**  
**Untuk mendapatkan isi berkas yang dikodekan basis-64 dalam sebuah repositori AWS CodeCommit **  
`get-file`Contoh berikut menunjukkan bagaimana untuk mendapatkan isi basis-64 dikodekan dari file bernama `README.md` dari cabang bernama dalam repositori bernama`main`. `MyDemoRepo`  

```
aws codecommit get-file \
    --repository-name MyDemoRepo \
    --commit-specifier main \
    --file-path README.md
```
Output:  

```
{
    "blobId":"559b44fEXAMPLE",
    "commitId":"c5709475EXAMPLE",
    "fileContent":"IyBQaHVzEXAMPLE",
    "filePath":"README.md",
    "fileMode":"NORMAL",
    "fileSize":1563
}
```
Untuk informasi selengkapnya, lihat [GetFile](https://docs.aws.amazon.com/codecommit/latest/APIReference/API_GetFile.html)di panduan *Referensi AWS CodeCommit API*.  
+  Untuk detail API, lihat [GetFile](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/get-file.html)di *Referensi AWS CLI Perintah*. 

### `get-folder`
<a name="codecommit_GetFolder_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`get-folder`.

**AWS CLI**  
**Untuk mendapatkan isi folder dalam AWS CodeCommit repositori**  
`get-folder`Contoh berikut menunjukkan bagaimana untuk mendapatkan isi dari folder tingkat atas dari repositori bernama. `MyDemoRepo`  

```
aws codecommit get-folder --repository-name MyDemoRepo --folder-path ""
```
Output:  

```
{
    "commitId":"c5709475EXAMPLE",
    "files":[
        {
            "absolutePath":".gitignore",
            "blobId":"74094e8bEXAMPLE",
            "fileMode":"NORMAL",
            "relativePath":".gitignore"
        },
        {
            "absolutePath":"Gemfile",
            "blobId":"9ceb72f6EXAMPLE",
            "fileMode":"NORMAL",
            "relativePath":"Gemfile"
        },
        {
            "absolutePath":"Gemfile.lock",
            "blobId":"795c4a2aEXAMPLE",
            "fileMode":"NORMAL",
            "relativePath":"Gemfile.lock"
        },
        {
            "absolutePath":"LICENSE.txt",
            "blobId":"0c7932c8EXAMPLE",
            "fileMode":"NORMAL",
            "relativePath":"LICENSE.txt"
        },
        {
            "absolutePath":"README.md",
            "blobId":"559b44feEXAMPLE",
            "fileMode":"NORMAL",
            "relativePath":"README.md"
        }
    ],
    "folderPath":"",
    "subFolders":[
        {
            "absolutePath":"public",
            "relativePath":"public",
            "treeId":"d5e92ae3aEXAMPLE"
        },
        {
            "absolutePath":"tmp",
            "relativePath":"tmp",
            "treeId":"d564d0bcEXAMPLE"
        }
    ],
    "subModules":[],
    "symbolicLinks":[],
    "treeId":"7b3c4dadEXAMPLE"
}
```
Untuk informasi selengkapnya, lihat GetFolder di panduan *Referensi AWS CodeCommit API*.  
+  Untuk detail API, lihat [GetFolder](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/get-folder.html)di *Referensi AWS CLI Perintah*. 

### `get-merge-commit`
<a name="codecommit_GetMergeCommit_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`get-merge-commit`.

**AWS CLI**  
**Untuk mendapatkan informasi rinci tentang komit gabungan**  
`get-merge-commit`Contoh berikut menampilkan rincian tentang komit gabungan untuk cabang sumber bernama `bugfix-bug1234` dengan cabang tujuan bernama `main` dalam repositori bernama. `MyDemoRepo`  

```
aws codecommit get-merge-commit \
    --source-commit-specifier bugfix-bug1234 \
    --destination-commit-specifier main \
    --repository-name MyDemoRepo
```
Output:  

```
{
    "sourceCommitId": "c5709475EXAMPLE",
    "destinationCommitId": "317f8570EXAMPLE",
    "baseCommitId": "fb12a539EXAMPLE",
    "mergeCommitId": "ffc4d608eEXAMPLE"
}
```
Untuk informasi selengkapnya, lihat [Melihat Detail Komit](https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-view-commit-details.html#how-to-view-commit-details-cli-merge-commit) di *Panduan AWS CodeCommit Pengguna*.  
+  Untuk detail API, lihat [GetMergeCommit](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/get-merge-commit.html)di *Referensi AWS CLI Perintah*. 

### `get-merge-conflicts`
<a name="codecommit_GetMergeConflicts_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`get-merge-conflicts`.

**AWS CLI**  
**Untuk melihat apakah ada konflik gabungan untuk permintaan tarik**  
`get-merge-conflicts`Contoh berikut menampilkan apakah ada konflik gabungan antara ujung cabang sumber bernama `feature-randomizationfeature` dan cabang tujuan bernama 'main' dalam repositori bernama. `MyDemoRepo`  

```
aws codecommit get-merge-conflicts \
    --repository-name MyDemoRepo \
    --source-commit-specifier feature-randomizationfeature \
    --destination-commit-specifier main \
    --merge-option THREE_WAY_MERGE
```
Output:  

```
{
    "mergeable": false,
    "destinationCommitId": "86958e0aEXAMPLE",
    "sourceCommitId": "6ccd57fdEXAMPLE",
    "baseCommitId": "767b6958EXAMPLE",
    "conflictMetadataList": [
        {
            "filePath": "readme.md",
            "fileSizes": {
                "source": 139,
                "destination": 230,
                "base": 85
            },
            "fileModes": {
                "source": "NORMAL",
                "destination": "NORMAL",
                "base": "NORMAL"
            },
            "objectTypes": {
                "source": "FILE",
                "destination": "FILE",
                "base": "FILE"
            },
            "numberOfConflicts": 1,
            "isBinaryFile": {
                "source": false,
                "destination": false,
                "base": false
            },
            "contentConflict": true,
            "fileModeConflict": false,
            "objectTypeConflict": false,
            "mergeOperations": {
                "source": "M",
                "destination": "M"
            }
        }
    ]
}
```
+  Untuk detail API, lihat [GetMergeConflicts](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/get-merge-conflicts.html)di *Referensi AWS CLI Perintah*. 

### `get-merge-options`
<a name="codecommit_GetMergeOptions_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`get-merge-options`.

**AWS CLI**  
**Untuk mendapatkan informasi tentang opsi penggabungan yang tersedia untuk menggabungkan dua cabang yang ditentukan**  
`get-merge-options`Contoh berikut menentukan opsi gabungan yang tersedia untuk menggabungkan cabang sumber bernama `bugfix-bug1234` dengan cabang tujuan bernama `main` dalam repositori bernama. `MyDemoRepo`  

```
aws codecommit get-merge-options \
    --source-commit-specifier bugfix-bug1234 \
    --destination-commit-specifier main \
    --repository-name MyDemoRepo
```
Output:  

```
{
    "mergeOptions": [
        "FAST_FORWARD_MERGE",
        "SQUASH_MERGE",
        "THREE_WAY_MERGE"
    ],
    "sourceCommitId": "18059494EXAMPLE",
    "destinationCommitId": "ffd3311dEXAMPLE",
    "baseCommitId": "ffd3311dEXAMPLE"
}
```
Untuk informasi selengkapnya, lihat [Menyelesaikan Konflik dalam Permintaan Tarik](https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-resolve-conflict-pull-request.html#get-merge-options) di *Panduan AWS CodeCommit Pengguna*.  
+  Untuk detail API, lihat [GetMergeOptions](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/get-merge-options.html)di *Referensi AWS CLI Perintah*. 

### `get-pull-request-approval-states`
<a name="codecommit_GetPullRequestApprovalStates_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`get-pull-request-approval-states`.

**AWS CLI**  
**Untuk melihat persetujuan pada permintaan tarik**  
`get-pull-request-approval-states`Contoh berikut mengembalikan persetujuan untuk permintaan tarik tertentu.  

```
aws codecommit get-pull-request-approval-states \
    --pull-request-id 8 \
    --revision-id 9f29d167EXAMPLE
```
Output:  

```
{
    "approvals": [
        {
            "userArn": "arn:aws:iam::123456789012:user/Mary_Major",
            "approvalState": "APPROVE"
        }
    ]
}
```
Untuk informasi selengkapnya, lihat [Melihat Permintaan Tarik](https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-view-pull-request.html#get-pull-request-approval-state) di *Panduan AWS CodeCommit Pengguna*.  
+  Untuk detail API, lihat [GetPullRequestApprovalStates](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/get-pull-request-approval-states.html)di *Referensi AWS CLI Perintah*. 

### `get-pull-request-override-state`
<a name="codecommit_GetPullRequestOverrideState_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`get-pull-request-override-state`.

**AWS CLI**  
**Untuk mendapatkan informasi tentang status penggantian permintaan tarik**  
`get-pull-request-override-state`Contoh berikut mengembalikan state override untuk pull request yang ditentukan. Dalam contoh ini, aturan persetujuan untuk permintaan tarik diganti oleh pengguna bernama Mary Major, sehingga output mengembalikan nilai. `true` :  

```
aws codecommit get-pull-request-override-state \
    --pull-request-id 34  \
    --revision-id 9f29d167EXAMPLE
```
Output:  

```
{
    "overridden": true,
    "overrider": "arn:aws:iam::123456789012:user/Mary_Major"
}
```
Untuk informasi selengkapnya, lihat [Mengganti Aturan Persetujuan pada Permintaan Tarik](https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-override-approval-rules.html#get-override-status) di *Panduan AWS CodeCommit Pengguna*.  
+  Untuk detail API, lihat [GetPullRequestOverrideState](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/get-pull-request-override-state.html)di *Referensi AWS CLI Perintah*. 

### `get-pull-request`
<a name="codecommit_GetPullRequest_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`get-pull-request`.

**AWS CLI**  
**Untuk melihat detail permintaan tarik**  
Contoh ini menunjukkan cara melihat informasi tentang permintaan tarik dengan ID dari. `27`  

```
aws codecommit get-pull-request \
    --pull-request-id 27
```
Output:  

```
{
    "pullRequest": {
        "approvalRules": [
            {
                "approvalRuleContent": "{\"Version\": \"2018-11-08\",\"Statements\": [{\"Type\": \"Approvers\",\"NumberOfApprovalsNeeded\": 2,\"ApprovalPoolMembers\": [\"arn:aws:sts::123456789012:assumed-role/CodeCommitReview/*\"]}]}",
                "approvalRuleId": "dd8b17fe-EXAMPLE",
                "approvalRuleName": "2-approver-rule-for-main",
                "creationDate": 1571356106.936,
                "lastModifiedDate": 571356106.936,
                "lastModifiedUser": "arn:aws:iam::123456789012:user/Mary_Major",
                "ruleContentSha256": "4711b576EXAMPLE"
            }
        ],
        "lastActivityDate": 1562619583.565,
        "pullRequestTargets": [
            {
                "sourceCommit": "ca45e279EXAMPLE",
                "sourceReference": "refs/heads/bugfix-1234",
                "mergeBase": "a99f5ddbEXAMPLE",
                "destinationReference": "refs/heads/main",
                "mergeMetadata": {
                    "isMerged": false
                },
                "destinationCommit": "2abfc6beEXAMPLE",
                "repositoryName": "MyDemoRepo"
            }
        ],
        "revisionId": "e47def21EXAMPLE",
        "title": "Quick fix for bug 1234",
        "authorArn": "arn:aws:iam::123456789012:user/Nikhil_Jayashankar",
        "clientRequestToken": "d8d7612e-EXAMPLE",
        "creationDate": 1562619583.565,
        "pullRequestId": "27",
        "pullRequestStatus": "OPEN"
    }
}
```
+  Untuk detail API, lihat [GetPullRequest](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/get-pull-request.html)di *Referensi AWS CLI Perintah*. 

### `get-repository-triggers`
<a name="codecommit_GetRepositoryTriggers_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`get-repository-triggers`.

**AWS CLI**  
**Untuk mendapatkan informasi tentang pemicu di repositori**  
Contoh ini menunjukkan detail tentang pemicu yang dikonfigurasi untuk AWS CodeCommit repositori bernama. `MyDemoRepo`  

```
aws codecommit get-repository-triggers \
    --repository-name MyDemoRepo
```
Output:  

```
{
    "configurationId": "f7579e13-b83e-4027-aaef-650c0EXAMPLE",
    "triggers": [
        {
            "destinationArn": "arn:aws:sns:us-east-1:111111111111:MyCodeCommitTopic",
            "branches": [
                "main",
                "preprod"
            ],
            "name": "MyFirstTrigger",
            "customData": "",
            "events": [
                "all"
            ]
        },
        {
            "destinationArn": "arn:aws:lambda:us-east-1:111111111111:function:MyCodeCommitPythonFunction",
            "branches": [],
            "name": "MySecondTrigger",
            "customData": "EXAMPLE",
            "events": [
                "all"
            ]
        }
    ]
}
```
+  Untuk detail API, lihat [GetRepositoryTriggers](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/get-repository-triggers.html)di *Referensi AWS CLI Perintah*. 

### `get-repository`
<a name="codecommit_GetRepository_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`get-repository`.

**AWS CLI**  
**Untuk mendapatkan informasi tentang repositori**  
Contoh ini menunjukkan rincian tentang AWS CodeCommit repositori.  

```
aws codecommit get-repository \
    --repository-name MyDemoRepo
```
Output:  

```
{
    "repositoryMetadata": {
        "creationDate": 1429203623.625,
        "defaultBranch": "main",
        "repositoryName": "MyDemoRepo",
        "cloneUrlSsh": "ssh://git-codecommit.us-east-1.amazonaws.com/v1/repos/v1/repos/MyDemoRepo",
        "lastModifiedDate": 1430783812.0869999,
        "repositoryDescription": "My demonstration repository",
        "cloneUrlHttp": "https://codecommit.us-east-1.amazonaws.com/v1/repos/MyDemoRepo",
        "repositoryId": "f7579e13-b83e-4027-aaef-650c0EXAMPLE",
        "Arn": "arn:aws:codecommit:us-east-1:80398EXAMPLE:MyDemoRepo
        "accountId": "111111111111"
    }
}
```
+  Untuk detail API, lihat [GetRepository](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/get-repository.html)di *Referensi AWS CLI Perintah*. 

### `list-approval-rule-templates`
<a name="codecommit_ListApprovalRuleTemplates_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`list-approval-rule-templates`.

**AWS CLI**  
**Untuk mencantumkan semua templat aturan persetujuan di AWS Wilayah**  
`list-approval-rule-templates`Contoh berikut mencantumkan semua templat aturan persetujuan di Wilayah tertentu. Jika tidak ada AWS Wilayah yang ditentukan sebagai parameter, perintah mengembalikan templat aturan persetujuan untuk wilayah yang ditentukan dalam profil AWS CLI yang digunakan untuk menjalankan perintah.  

```
aws codecommit list-approval-rule-templates \
    --region us-east-2
```
Output:  

```
{
    "approvalRuleTemplateNames": [
        "2-approver-rule-for-main",
        "1-approver-rule-for-all-pull-requests"
    ]
}
```
Untuk informasi selengkapnya, lihat [Mengelola Template Aturan Persetujuan](https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-manage-templates.html#list-templates) di *Panduan AWS CodeCommit Pengguna*.  
+  Untuk detail API, lihat [ListApprovalRuleTemplates](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/list-approval-rule-templates.html)di *Referensi AWS CLI Perintah*. 

### `list-associated-approval-rule-templates-for-repository`
<a name="codecommit_ListAssociatedApprovalRuleTemplatesForRepository_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`list-associated-approval-rule-templates-for-repository`.

**AWS CLI**  
**Untuk daftar semua template yang terkait dengan repositori**  
`list-associated-approval-rule-templates-for-repository`Contoh berikut mencantumkan semua template aturan persetujuan yang terkait dengan repositori bernama. `MyDemoRepo`  

```
aws codecommit list-associated-approval-rule-templates-for-repository \
    --repository-name MyDemoRepo
```
Output:  

```
{
  "approvalRuleTemplateNames": [
    "2-approver-rule-for-main",
    "1-approver-rule-for-all-pull-requests"
  ]
}
```
Untuk informasi selengkapnya, lihat [Mengelola Template Aturan Persetujuan](https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-manage-templates.html#list-associated-templates) di *Panduan AWS CodeCommit Pengguna*.  
+  Untuk detail API, lihat [ListAssociatedApprovalRuleTemplatesForRepository](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/list-associated-approval-rule-templates-for-repository.html)di *Referensi AWS CLI Perintah*. 

### `list-branches`
<a name="codecommit_ListBranches_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`list-branches`.

**AWS CLI**  
**Untuk melihat daftar nama cabang**  
Contoh ini mencantumkan semua nama cabang dalam AWS CodeCommit repositori.  

```
aws codecommit list-branches \
    --repository-name MyDemoRepo
```
Output:  

```
{
    "branches": [
        "MyNewBranch",
        "main"
    ]
}
```
+  Untuk detail API, lihat [ListBranches](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/list-branches.html)di *Referensi AWS CLI Perintah*. 

### `list-pull-requests`
<a name="codecommit_ListPullRequests_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`list-pull-requests`.

**AWS CLI**  
**Untuk melihat daftar permintaan tarik dalam repositori**  
Contoh ini menunjukkan cara membuat daftar permintaan tarik yang dibuat oleh pengguna IAM dengan ARN 'arn:aws:iam: :1111111111:user/LI\$1JUAN' dan status 'CLOSED' di repositori bernama '': AWS CodeCommit MyDemoRepo  

```
aws codecommit list-pull-requests --author-arn arn:aws:iam::111111111111:user/Li_Juan --pull-request-status CLOSED --repository-name MyDemoRepo
```
Output:  

```
{
 "nextToken": "",
 "pullRequestIds": ["2","12","16","22","23","35","30","39","47"]
}
```
+  Untuk detail API, lihat [ListPullRequests](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/list-pull-requests.html)di *Referensi AWS CLI Perintah*. 

### `list-repositories-for-approval-rule-template`
<a name="codecommit_ListRepositoriesForApprovalRuleTemplate_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`list-repositories-for-approval-rule-template`.

**AWS CLI**  
**Untuk daftar semua repositori yang terkait dengan template**  
`list-repositories-for-approval-rule-template`Contoh berikut mencantumkan semua repositori yang terkait dengan template aturan persetujuan yang ditentukan.  

```
aws codecommit list-repositories-for-approval-rule-template \
    --approval-rule-template-name 2-approver-rule-for-main
```
Output:  

```
{
    "repositoryNames": [
        "MyDemoRepo",
        "MyClonedRepo"
    ]
}
```
Untuk informasi selengkapnya, lihat [Mengelola Template Aturan Persetujuan](https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-manage-templates.html#list-associated-repositories) di *Panduan AWS CodeCommit Pengguna*.  
+  Untuk detail API, lihat [ListRepositoriesForApprovalRuleTemplate](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/list-repositories-for-approval-rule-template.html)di *Referensi AWS CLI Perintah*. 

### `list-repositories`
<a name="codecommit_ListRepositories_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`list-repositories`.

**AWS CLI**  
**Untuk melihat daftar repositori**  
Contoh ini mencantumkan semua AWS CodeCommit repositori yang terkait dengan akun pengguna. AWS   
Perintah:  

```
aws codecommit list-repositories
```
Output:  

```
{
  "repositories": [
      {
         "repositoryName": "MyDemoRepo"
         "repositoryId": "f7579e13-b83e-4027-aaef-650c0EXAMPLE",
      },
      {
         "repositoryName": "MyOtherDemoRepo"
         "repositoryId": "cfc29ac4-b0cb-44dc-9990-f6f51EXAMPLE"
      }
  ]
}
```
+  Untuk detail API, lihat [ListRepositories](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/list-repositories.html)di *Referensi AWS CLI Perintah*. 

### `list-tags-for-resource`
<a name="codecommit_ListTagsForResource_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`list-tags-for-resource`.

**AWS CLI**  
**Untuk melihat AWS tag untuk repositori**  
`list-tags-for-resource`Contoh berikut mencantumkan kunci tag dan nilai tag untuk repositori tertentu.  

```
aws codecommit list-tags-for-resource \
    --resource-arn arn:aws:codecommit:us-west-2:111111111111:MyDemoRepo
```
Output:  

```
{
    "tags": {
        "Status": "Secret",
        "Team": "Saanvi"
    }
}
```
Untuk informasi selengkapnya, [lihat Melihat Tag untuk Repositori](https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-tag-repository-list.html#how-to-tag-repository-list-cli) di *AWS CodeCommit Panduan Pengguna*.  
+  Untuk detail API, lihat [ListTagsForResource](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/list-tags-for-resource.html)di *Referensi AWS CLI Perintah*. 

### `merge-branches-by-fast-forward`
<a name="codecommit_MergeBranchesByFastForward_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`merge-branches-by-fast-forward`.

**AWS CLI**  
**Untuk menggabungkan dua cabang menggunakan strategi penggabungan maju cepat**  
`merge-branches-by-fast-forward`Contoh berikut menggabungkan cabang sumber yang ditentukan dengan cabang tujuan tertentu dalam repositori bernama. `MyDemoRepo`  

```
aws codecommit merge-branches-by-fast-forward \
    --source-commit-specifier bugfix-bug1234 \
    --destination-commit-specifier bugfix-bug1233 \
    --repository-name MyDemoRepo
```
Output:  

```
{
    "commitId": "4f178133EXAMPLE",
    "treeId": "389765daEXAMPLE"
}
```
Untuk informasi selengkapnya, lihat [Membandingkan dan Menggabungkan Cabang](https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-compare-branches.html#merge-branches-by-fast-forward) di *Panduan AWS CodeCommit Pengguna*.  
+  Untuk detail API, lihat [MergeBranchesByFastForward](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/merge-branches-by-fast-forward.html)di *Referensi AWS CLI Perintah*. 

### `merge-branches-by-squash`
<a name="codecommit_MergeBranchesBySquash_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`merge-branches-by-squash`.

**AWS CLI**  
**Untuk menggabungkan dua cabang menggunakan strategi penggabungan squash**  
`merge-branches-by-squash`Contoh berikut menggabungkan cabang sumber yang ditentukan dengan cabang tujuan tertentu dalam repositori bernama. `MyDemoRepo`  

```
aws codecommit merge-branches-by-squash \
    --source-commit-specifier bugfix-bug1234 \
    --destination-commit-specifier bugfix-bug1233 \
    --author-name "Maria Garcia" \
    --email "maria_garcia@example.com" \
    --commit-message "Merging two fix branches to prepare for a general patch." \
    --repository-name MyDemoRepo
```
Output:  

```
{
    "commitId": "4f178133EXAMPLE",
    "treeId": "389765daEXAMPLE"
}
```
Untuk informasi selengkapnya, lihat [Membandingkan dan Menggabungkan Cabang](https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-compare-branches.html#merge-branches-by-squash) di *Panduan AWS CodeCommit Pengguna*.  
+  Untuk detail API, lihat [MergeBranchesBySquash](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/merge-branches-by-squash.html)di *Referensi AWS CLI Perintah*. 

### `merge-branches-by-three-way`
<a name="codecommit_MergeBranchesByThreeWay_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`merge-branches-by-three-way`.

**AWS CLI**  
**Untuk menggabungkan dua cabang menggunakan strategi penggabungan tiga arah**  
`merge-branches-by-three-way`Contoh berikut menggabungkan cabang sumber yang ditentukan dengan cabang tujuan tertentu dalam repositori bernama. `MyDemoRepo`  

```
aws codecommit merge-branches-by-three-way \
    --source-commit-specifier main \
    --destination-commit-specifier bugfix-bug1234 \
    --author-name "Jorge Souza" --email "jorge_souza@example.com" \
    --commit-message "Merging changes from main to bugfix branch before additional testing." \
    --repository-name MyDemoRepo
```
Output:  

```
{
    "commitId": "4f178133EXAMPLE",
    "treeId": "389765daEXAMPLE"
}
```
Untuk informasi selengkapnya, lihat [Membandingkan dan Menggabungkan Cabang](https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-compare-branches.html#merge-branches-by-three-way) di *Panduan AWS CodeCommit Pengguna*.  
+  Untuk detail API, lihat [MergeBranchesByThreeWay](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/merge-branches-by-three-way.html)di *Referensi AWS CLI Perintah*. 

### `merge-pull-request-by-fast-forward`
<a name="codecommit_MergePullRequestByFastForward_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`merge-pull-request-by-fast-forward`.

**AWS CLI**  
**Untuk menggabungkan dan menutup permintaan tarik**  
Contoh ini menunjukkan cara menggabungkan dan menutup permintaan tarik dengan ID '47' dan ID komit sumber '99132AB0Example' dalam repositori bernama. `MyDemoRepo`  

```
aws codecommit merge-pull-request-by-fast-forward \
    --pull-request-id 47 \
    --source-commit-id 99132ab0EXAMPLE \
    --repository-name MyDemoRepo
```
Output:  

```
{
    "pullRequest": {
        "approvalRules": [
            {
                "approvalRuleContent": "{\"Version\": \"2018-11-08\",\"Statements\": [{\"Type\": \"Approvers\",\"NumberOfApprovalsNeeded\": 1,\"ApprovalPoolMembers\": [\"arn:aws:sts::123456789012:assumed-role/CodeCommitReview/*\"]}]}",
                "approvalRuleId": "dd8b17fe-EXAMPLE",
                "approvalRuleName": "I want one approver for this pull request",
                "creationDate": 1571356106.936,
                "lastModifiedDate": 571356106.936,
                "lastModifiedUser": "arn:aws:iam::123456789012:user/Mary_Major",
                "ruleContentSha256": "4711b576EXAMPLE"
            }
        ],
        "authorArn": "arn:aws:iam::123456789012:user/Li_Juan",
        "clientRequestToken": "",
        "creationDate": 1508530823.142,
        "description": "Review the latest changes and updates to the global variables",
        "lastActivityDate": 1508887223.155,
        "pullRequestId": "47",
        "pullRequestStatus": "CLOSED",
        "pullRequestTargets": [
            {
                "destinationCommit": "9f31c968EXAMPLE",
                "destinationReference": "refs/heads/main",
                "mergeMetadata": {
                    "isMerged": true,
                    "mergedBy": "arn:aws:iam::123456789012:user/Mary_Major"
                },
                "repositoryName": "MyDemoRepo",
                "sourceCommit": "99132ab0EXAMPLE",
                "sourceReference": "refs/heads/variables-branch"
            }
        ],
        "title": "Consolidation of global variables"
    }
}
```
Untuk informasi selengkapnya, lihat [Menggabungkan Permintaan Tarik](https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-merge-pull-request.html#merge-pull-request-by-fast-forward) di *Panduan AWS CodeCommit Pengguna*.  
+  Untuk detail API, lihat [MergePullRequestByFastForward](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/merge-pull-request-by-fast-forward.html)di *Referensi AWS CLI Perintah*. 

### `merge-pull-request-by-squash`
<a name="codecommit_MergePullRequestBySquash_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`merge-pull-request-by-squash`.

**AWS CLI**  
**Untuk menggabungkan permintaan tarik menggunakan strategi penggabungan squash**  
`merge-pull-request-by-squash`Contoh berikut menggabungkan dan menutup permintaan tarik yang ditentukan menggunakan strategi resolusi konflik ACCEPT\$1SOURCE dalam repositori bernama. `MyDemoRepo`  

```
aws codecommit merge-pull-request-by-squash \
    --pull-request-id 47 \
    --source-commit-id 99132ab0EXAMPLE \
    --repository-name MyDemoRepo \
    --conflict-detail-level LINE_LEVEL \
    --conflict-resolution-strategy ACCEPT_SOURCE \
    --name "Jorge Souza" --email "jorge_souza@example.com" \
    --commit-message "Merging pull request 47 by squash and accepting source in merge conflicts"
```
Output:  

```
{
    "pullRequest": {
        "approvalRules": [
            {
                "approvalRuleContent": "{\"Version\": \"2018-11-08\",\"DestinationReferences\": [\"refs/heads/main\"],\"Statements\": [{\"Type\": \"Approvers\",\"NumberOfApprovalsNeeded\": 2,\"ApprovalPoolMembers\": [\"arn:aws:sts::123456789012:assumed-role/CodeCommitReview/*\"]}]}",
                "approvalRuleId": "dd8b17fe-EXAMPLE",
                "approvalRuleName": "2-approver-rule-for-main",
                "creationDate": 1571356106.936,
                "lastModifiedDate": 571356106.936,
                "lastModifiedUser": "arn:aws:iam::123456789012:user/Mary_Major",
                "originApprovalRuleTemplate": {
                    "approvalRuleTemplateId": "dd8b17fe-EXAMPLE",
                    "approvalRuleTemplateName": "2-approver-rule-for-main"
                },
                "ruleContentSha256": "4711b576EXAMPLE"
            }
        ],
        "authorArn": "arn:aws:iam::123456789012:user/Li_Juan",
        "clientRequestToken": "",
        "creationDate": 1508530823.142,
        "description": "Review the latest changes and updates to the global variables",
        "lastActivityDate": 1508887223.155,
        "pullRequestId": "47",
        "pullRequestStatus": "CLOSED",
        "pullRequestTargets": [
            {
                "destinationCommit": "9f31c968EXAMPLE",
                "destinationReference": "refs/heads/main",
                "mergeMetadata": {
                    "isMerged": true,
                    "mergedBy": "arn:aws:iam::123456789012:user/Mary_Major"
                },
                "repositoryName": "MyDemoRepo",
                "sourceCommit": "99132ab0EXAMPLE",
                "sourceReference": "refs/heads/variables-branch"
            }
        ],
        "title": "Consolidation of global variables"
    }
}
```
Untuk informasi selengkapnya, lihat [Menggabungkan Permintaan Tarik](https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-merge-pull-request.html#merge-pull-request-by-squash) di *Panduan AWS CodeCommit Pengguna*.  
+  Untuk detail API, lihat [MergePullRequestBySquash](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/merge-pull-request-by-squash.html)di *Referensi AWS CLI Perintah*. 

### `merge-pull-request-by-three-way`
<a name="codecommit_MergePullRequestByThreeWay_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`merge-pull-request-by-three-way`.

**AWS CLI**  
**Untuk menggabungkan permintaan tarik menggunakan strategi penggabungan tiga arah**  
`merge-pull-request-by-three-way`Contoh berikut menggabungkan dan menutup permintaan tarik yang ditentukan menggunakan opsi default untuk detail konflik dan strategi resolusi konflik dalam repositori bernama. `MyDemoRepo`  

```
aws codecommit merge-pull-request-by-three-way \
    --pull-request-id 47 \
    --source-commit-id 99132ab0EXAMPLE \
    --repository-name MyDemoRepo \
    --name "Maria Garcia" \
    --email "maria_garcia@example.com" \
    --commit-message "Merging pull request 47 by three-way with default options"
```
Output:  

```
{
    "pullRequest": {
        "approvalRules": [
            {
                "approvalRuleContent": "{\"Version\": \"2018-11-08\",\"DestinationReferences\": [\"refs/heads/main\"],\"Statements\": [{\"Type\": \"Approvers\",\"NumberOfApprovalsNeeded\": 2,\"ApprovalPoolMembers\": [\"arn:aws:sts::123456789012:assumed-role/CodeCommitReview/*\"]}]}",
                "approvalRuleId": "dd8b17fe-EXAMPLE",
                "approvalRuleName": "2-approver-rule-for-main",
                "creationDate": 1571356106.936,
                "lastModifiedDate": 571356106.936,
                "lastModifiedUser": "arn:aws:iam::123456789012:user/Mary_Major",
                "originApprovalRuleTemplate": {
                    "approvalRuleTemplateId": "dd8b17fe-EXAMPLE",
                    "approvalRuleTemplateName": "2-approver-rule-for-main"
                },
                "ruleContentSha256": "4711b576EXAMPLE"
            }
        ],
        "authorArn": "arn:aws:iam::123456789012:user/Li_Juan",
        "clientRequestToken": "",
        "creationDate": 1508530823.142,
        "description": "Review the latest changes and updates to the global variables",
        "lastActivityDate": 1508887223.155,
        "pullRequestId": "47",
        "pullRequestStatus": "CLOSED",
        "pullRequestTargets": [
            {
                "destinationCommit": "9f31c968EXAMPLE",
                "destinationReference": "refs/heads/main",
                "mergeMetadata": {
                    "isMerged": true,
                    "mergedBy": "arn:aws:iam::123456789012:user/Mary_Major"
                },
                "repositoryName": "MyDemoRepo",
                "sourceCommit": "99132ab0EXAMPLE",
                "sourceReference": "refs/heads/variables-branch"
            }
        ],
        "title": "Consolidation of global variables"
    }
}
```
Untuk informasi selengkapnya, lihat [Menggabungkan Permintaan Tarik](https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-merge-pull-request.html#merge-pull-request-by-three-way) di *Panduan AWS CodeCommit Pengguna*.  
+  Untuk detail API, lihat [MergePullRequestByThreeWay](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/merge-pull-request-by-three-way.html)di *Referensi AWS CLI Perintah*. 

### `override-pull-request-approval-rules`
<a name="codecommit_OverridePullRequestApprovalRules_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`override-pull-request-approval-rules`.

**AWS CLI**  
**Untuk mengganti persyaratan aturan persetujuan pada permintaan tarik**  
`override-pull-request-approval-rules`Contoh berikut mengesampingkan aturan persetujuan pada permintaan tarik yang ditentukan. Untuk mencabut penggantian sebagai gantinya, setel nilai `--override-status` parameter ke. `REVOKE`  

```
aws codecommit override-pull-request-approval-rules \
    --pull-request-id 34  \
    --revision-id 927df8d8EXAMPLE \
    --override-status OVERRIDE
```
Perintah ini tidak menghasilkan output.  
Untuk informasi selengkapnya, lihat [Mengganti Aturan Persetujuan pada Permintaan Tarik](https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-override-approval-rules.html#override-approval-rules) di *Panduan AWS CodeCommit Pengguna*.  
+  Untuk detail API, lihat [OverridePullRequestApprovalRules](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/override-pull-request-approval-rules.html)di *Referensi AWS CLI Perintah*. 

### `post-comment-for-compared-commit`
<a name="codecommit_PostCommentForComparedCommit_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`post-comment-for-compared-commit`.

**AWS CLI**  
**Untuk membuat komentar pada komit**  
Contoh ini menunjukkan cara menambahkan komentar `"Can you add a test case for this?"` pada perubahan ke `cl_sample.js` file dalam perbandingan antara dua komit dalam repositori bernama. `MyDemoRepo`  

```
aws codecommit post-comment-for-compared-commit \
    --repository-name MyDemoRepo \
    --before-commit-id 317f8570EXAMPLE \
    --after-commit-id 5d036259EXAMPLE \
    --client-request-token 123Example \
    --content "Can you add a test case for this?" \
    --location filePath=cl_sample.js,filePosition=1232,relativeFileVersion=AFTER
```
Output:  

```
{
    "afterBlobId": "1f330709EXAMPLE",
    "afterCommitId": "317f8570EXAMPLE",
    "beforeBlobId": "80906a4cEXAMPLE",
    "beforeCommitId": "6e147360EXAMPLE",
    "comment": {
        "authorArn": "arn:aws:iam::111111111111:user/Li_Juan",
        "clientRequestToken": "",
        "commentId": "553b509bEXAMPLE56198325",
        "content": "Can you add a test case for this?",
        "creationDate": 1508369612.203,
        "deleted": false,
        "commentId": "abc123-EXAMPLE",
        "lastModifiedDate": 1508369612.203,
        "callerReactions": [],
        "reactionCounts": []
    },
    "location": {
        "filePath": "cl_sample.js",
        "filePosition": 1232,
        "relativeFileVersion": "AFTER"
    ,
    "repositoryName": "MyDemoRepo"
    }
}
```
+  Untuk detail API, lihat [PostCommentForComparedCommit](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/post-comment-for-compared-commit.html)di *Referensi AWS CLI Perintah*. 

### `post-comment-for-pull-request`
<a name="codecommit_PostCommentForPullRequest_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`post-comment-for-pull-request`.

**AWS CLI**  
**Untuk menambahkan komentar ke permintaan tarik**  
`post-comment-for-pull-request`Contoh berikut menambahkan komentar “Ini tampaknya tidak digunakan di mana pun. Bisakah kita menghapusnya?" pada perubahan ke `ahs_count.py` file dalam permintaan tarik dengan ID `47` dalam repositori bernama. `MyDemoRepo`  

```
aws codecommit post-comment-for-pull-request \
    --pull-request-id "47" \
    --repository-name MyDemoRepo \
    --before-commit-id 317f8570EXAMPLE \
    --after-commit-id 5d036259EXAMPLE \
    --client-request-token 123Example \
    --content "These don't appear to be used anywhere. Can we remove them?" \
    --location filePath=ahs_count.py,filePosition=367,relativeFileVersion=AFTER
```
Output:  

```
{
     "afterBlobId": "1f330709EXAMPLE",
     "afterCommitId": "5d036259EXAMPLE",
     "beforeBlobId": "80906a4cEXAMPLE",
     "beforeCommitId": "317f8570EXAMPLE",
     "comment": {
            "authorArn": "arn:aws:iam::111111111111:user/Saanvi_Sarkar",
            "clientRequestToken": "123Example",
            "commentId": "abcd1234EXAMPLEb5678efgh",
            "content": "These don't appear to be used anywhere. Can we remove them?",
            "creationDate": 1508369622.123,
            "deleted": false,
            "CommentId": "",
            "lastModifiedDate": 1508369622.123,
            "callerReactions": [],
            "reactionCounts": []
        },
        "location": {
            "filePath": "ahs_count.py",
            "filePosition": 367,
            "relativeFileVersion": "AFTER"
         },
     "repositoryName": "MyDemoRepo",
     "pullRequestId": "47"
}
```
+  Untuk detail API, lihat [PostCommentForPullRequest](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/post-comment-for-pull-request.html)di *Referensi AWS CLI Perintah*. 

### `post-comment-reply`
<a name="codecommit_PostCommentReply_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`post-comment-reply`.

**AWS CLI**  
**Untuk membalas komentar pada komit atau permintaan tarik**  
Contoh ini menunjukkan cara menambahkan balasan `"Good catch. I'll remove them."` ke komentar dengan ID yang dihasilkan sistem dari. `abcd1234EXAMPLEb5678efgh`  

```
aws codecommit post-comment-reply \
    --in-reply-to abcd1234EXAMPLEb5678efgh \
    --content "Good catch. I'll remove them." \
    --client-request-token 123Example
```
Output:  

```
{
    "comment": {
        "authorArn": "arn:aws:iam::111111111111:user/Li_Juan",
        "clientRequestToken": "123Example",
        "commentId": "442b498bEXAMPLE5756813",
        "content": "Good catch. I'll remove them.",
        "creationDate": 1508369829.136,
        "deleted": false,
        "CommentId": "abcd1234EXAMPLEb5678efgh",
        "lastModifiedDate": 150836912.221,
        "callerReactions": [],
        "reactionCounts": []
    }
}
```
+  Untuk detail API, lihat [PostCommentReply](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/post-comment-reply.html)di *Referensi AWS CLI Perintah*. 

### `put-comment-reaction`
<a name="codecommit_PutCommentReaction_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`put-comment-reaction`.

**AWS CLI**  
**Untuk membalas komentar pada komit dengan emoji**  
`put-comment-reaction`Contoh berikut membalas komentar dengan ID dari `abcd1234EXAMPLEb5678efgh` dengan nilai reaksi emoji. `:thumbsup:`  

```
aws codecommit put-comment-reaction \
    --comment-id abcd1234EXAMPLEb5678efgh \
    --reaction-value :thumbsup:
```
Perintah ini tidak menghasilkan output.  
Untuk informasi selengkapnya, lihat [Mengomentari komit AWS CodeCommit di](https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-commit-comment.html#how-to-commit-comment-cli-commit-reply-emoji) *Panduan AWS CodeCommit Pengguna*.  
+  Untuk detail API, lihat [PutCommentReaction](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/put-comment-reaction.html)di *Referensi AWS CLI Perintah*. 

### `put-file`
<a name="codecommit_PutFile_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`put-file`.

**AWS CLI**  
**Untuk menambahkan file ke repositori**  
`put-file`Contoh berikut menambahkan file bernama 'ExampleSolution.py' ke repositori bernama' 'ke cabang bernama' feature-randomizationfeature MyDemoRepo 'yang komit terbarunya memiliki ID '4C925148Example'.  

```
aws codecommit put-file \
    --repository-name MyDemoRepo \
    --branch-name feature-randomizationfeature \
    --file-content file://MyDirectory/ExampleSolution.py \
    --file-path /solutions/ExampleSolution.py \
    --parent-commit-id 4c925148EXAMPLE \
    --name "Maria Garcia" \
    --email "maria_garcia@example.com" \
    --commit-message "I added a third randomization routine."
```
Output:  

```
{
    "blobId": "2eb4af3bEXAMPLE",
    "commitId": "317f8570EXAMPLE",
    "treeId": "347a3408EXAMPLE"
}
```
+  Untuk detail API, lihat [PutFile](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/put-file.html)di *Referensi AWS CLI Perintah*. 

### `put-repository-triggers`
<a name="codecommit_PutRepositoryTriggers_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`put-repository-triggers`.

**AWS CLI**  
**Untuk menambah atau memperbarui pemicu di repositori**  
Contoh ini menunjukkan cara memperbarui pemicu bernama '' dan 'MyFirstTriggerMySecondTrigger' menggunakan file JSON yang sudah dibuat (di sini bernama MyTriggers .json) yang berisi struktur semua pemicu untuk repositori bernama. MyDemoRepo Untuk mempelajari cara mendapatkan JSON untuk pemicu yang ada, lihat perintahnya. get-repository-triggers  

```
aws codecommit put-repository-triggers \
    --repository-name MyDemoRepo file://MyTriggers.json
```
Isi dari `MyTriggers.json`:  

```
{
    "repositoryName": "MyDemoRepo",
    "triggers": [
        {
            "destinationArn": "arn:aws:sns:us-east-1:80398EXAMPLE:MyCodeCommitTopic",
            "branches": [
                "main",
                "preprod"
            ],
            "name": "MyFirstTrigger",
            "customData": "",
            "events": [
                "all"
            ]
        },
        {
            "destinationArn": "arn:aws:lambda:us-east-1:111111111111:function:MyCodeCommitPythonFunction",
            "branches": [],
            "name": "MySecondTrigger",
            "customData": "EXAMPLE",
            "events": [
                "all"
            ]
        }
    ]
}
```
Output:  

```
{
    "configurationId": "6fa51cd8-35c1-EXAMPLE"
}
```
+  Untuk detail API, lihat [PutRepositoryTriggers](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/put-repository-triggers.html)di *Referensi AWS CLI Perintah*. 

### `tag-resource`
<a name="codecommit_TagResource_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`tag-resource`.

**AWS CLI**  
**Untuk menambahkan AWS tag ke repositori yang ada**  
`tag-resource`Contoh berikut tag repositori yang ditentukan dengan dua tag.  

```
aws codecommit tag-resource \
    --resource-arn arn:aws:codecommit:us-west-2:111111111111:MyDemoRepo \
    --tags Status=Secret,Team=Saanvi
```
Perintah ini tidak menghasilkan output.  
Untuk informasi selengkapnya, lihat [Menambahkan Tag ke Repositori](https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-tag-repository-add.html#how-to-tag-repository-add-cli) di *AWS CodeCommit Panduan Pengguna*.  
+  Untuk detail API, lihat [TagResource](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/tag-resource.html)di *Referensi AWS CLI Perintah*. 

### `test-repository-triggers`
<a name="codecommit_TestRepositoryTriggers_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`test-repository-triggers`.

**AWS CLI**  
**Untuk menguji pemicu dalam repositori**  
Contoh ini menunjukkan bagaimana untuk menguji pemicu bernama 'MyFirstTrigger' dalam AWS CodeCommit repositori bernama. MyDemoRepo Dalam contoh ini, peristiwa di repositori memicu pemberitahuan dari topik Simple Notification Service Amazon (Amazon SNS).  
Perintah:  

```
aws codecommit test-repository-triggers --repository-name MyDemoRepo --triggers name=MyFirstTrigger,destinationArn=arn:aws:sns:us-east-1:111111111111:MyCodeCommitTopic,branches=mainline,preprod,events=all
```
Output:  

```
{
  "successfulExecutions": [
      "MyFirstTrigger"
  ],
  "failedExecutions": []
}
```
+  Untuk detail API, lihat [TestRepositoryTriggers](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/test-repository-triggers.html)di *Referensi AWS CLI Perintah*. 

### `untag-resource`
<a name="codecommit_UntagResource_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`untag-resource`.

**AWS CLI**  
**Untuk menghapus AWS tag dari repositori**  
`untag-resource`Contoh berikut menghapus tag dengan kunci yang ditentukan dari repositori bernama. `MyDemoRepo`  

```
aws codecommit untag-resource \
    --resource-arn arn:aws:codecommit:us-west-2:111111111111:MyDemoRepo \
    --tag-keys Status
```
Perintah ini tidak menghasilkan output.  
Untuk informasi selengkapnya, lihat [Menghapus Tag dari Repositori](https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-tag-repository-delete.html#how-to-tag-repository-delete-cli) di *AWS CodeCommit Panduan Pengguna*.  
+  Untuk detail API, lihat [UntagResource](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/untag-resource.html)di *Referensi AWS CLI Perintah*. 

### `update-approval-rule-template-content`
<a name="codecommit_UpdateApprovalRuleTemplateContent_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`update-approval-rule-template-content`.

**AWS CLI**  
**Untuk memperbarui konten templat aturan persetujuan**  
`update-approval-rule-template-content`Contoh berikut mengubah konten templat aturan persetujuan yang ditentukan untuk mendefinisikan ulang kumpulan persetujuan kepada pengguna yang berperan. `CodeCommitReview`  

```
aws codecommit update-approval-rule-template-content \
    --approval-rule-template-name 1-approver-rule  \
    --new-rule-content "{\"Version\": \"2018-11-08\",\"DestinationReferences\": [\"refs/heads/main\"],\"Statements\": [{\"Type\": \"Approvers\",\"NumberOfApprovalsNeeded\": 2,\"ApprovalPoolMembers\": [\"arn:aws:sts::123456789012:assumed-role/CodeCommitReview/*\"]}]}"
```
Output:  

```
{
    "approvalRuleTemplate": {
        "creationDate": 1571352720.773,
        "approvalRuleTemplateDescription": "Requires 1 approval for all pull requests from the CodeCommitReview pool",
        "lastModifiedDate": 1571358728.41,
        "approvalRuleTemplateId": "41de97b7-EXAMPLE",
        "approvalRuleTemplateContent": "{\"Version\": \"2018-11-08\",\"Statements\": [{\"Type\": \"Approvers\",\"NumberOfApprovalsNeeded\": 1,\"ApprovalPoolMembers\": [\"arn:aws:sts::123456789012:assumed-role/CodeCommitReview/*\"]}]}",
        "approvalRuleTemplateName": "1-approver-rule-for-all-pull-requests",
        "ruleContentSha256": "2f6c21a5EXAMPLE",
        "lastModifiedUser": "arn:aws:iam::123456789012:user/Li_Juan"
    }
}
```
Untuk informasi selengkapnya, lihat [Mengelola Template Aturan Persetujuan](https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-manage-templates.html#update-template-content) di *Panduan AWS CodeCommit Pengguna*.  
+  Untuk detail API, lihat [UpdateApprovalRuleTemplateContent](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/update-approval-rule-template-content.html)di *Referensi AWS CLI Perintah*. 

### `update-approval-rule-template-description`
<a name="codecommit_UpdateApprovalRuleTemplateDescription_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`update-approval-rule-template-description`.

**AWS CLI**  
**Untuk memperbarui deskripsi templat aturan persetujuan**  
`update-approval-rule-template-description`Contoh berikut mengubah deskripsi template aturan persetujuan yang ditentukan menjadi`Requires 1 approval for all pull requests from the CodeCommitReview pool`. :  

```
aws codecommit update-approval-rule-template-description \
    --approval-rule-template-name 1-approver-rule-for-all-pull-requests  \
    --approval-rule-template-description "Requires 1 approval for all pull requests from the CodeCommitReview pool"
```
Output:  

```
{
  "approvalRuleTemplate": {
    "creationDate": 1571352720.773,
    "approvalRuleTemplateDescription": "Requires 1 approval for all pull requests from the CodeCommitReview pool",
    "lastModifiedDate": 1571358728.41,
    "approvalRuleTemplateId": "41de97b7-EXAMPLE",
    "approvalRuleTemplateContent": "{\"Version\": \"2018-11-08\",\"Statements\": [{\"Type\": \"Approvers\",\"NumberOfApprovalsNeeded\": 1,\"ApprovalPoolMembers\": [\"arn:aws:sts::123456789012:assumed-role/CodeCommitReview/*\"]}]}",
    "approvalRuleTemplateName": "1-approver-rule-for-all-pull-requests",
    "ruleContentSha256": "2f6c21a5EXAMPLE",
    "lastModifiedUser": "arn:aws:iam::123456789012:user/Li_Juan"
  }
}
```
Untuk informasi selengkapnya, lihat [Mengelola Template Aturan Persetujuan](https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-manage-templates.html#update-template-description) di *Panduan AWS CodeCommit Pengguna*.  
+  Untuk detail API, lihat [UpdateApprovalRuleTemplateDescription](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/update-approval-rule-template-description.html)di *Referensi AWS CLI Perintah*. 

### `update-approval-rule-template-name`
<a name="codecommit_UpdateApprovalRuleTemplateName_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`update-approval-rule-template-name`.

**AWS CLI**  
**Untuk memperbarui nama templat aturan persetujuan**  
`update-approval-rule-template-name`Contoh berikut mengubah nama template aturan persetujuan dari 1- `1-approver-rule` approver-rule-for-all -pull-requests`.  

```
aws codecommit update-approval-rule-template-name \
    --old-approval-rule-template-name 1-approver-rule  \
    --new-approval-rule-template-name 1-approver-rule-for-all-pull-requests
```
Output:  

```
{
  "approvalRuleTemplate": {
    "approvalRuleTemplateName": "1-approver-rule-for-all-pull-requests",
    "lastModifiedDate": 1571358241.619,
    "approvalRuleTemplateId": "41de97b7-EXAMPLE",
    "approvalRuleTemplateContent": "{\"Version\": \"2018-11-08\",\"Statements\": [{\"Type\": \"Approvers\",\"NumberOfApprovalsNeeded\": 1,\"ApprovalPoolMembers\": [\"arn:aws:sts::123456789012:assumed-role/CodeCommitReview/*\"]}]}",
    "creationDate": 1571352720.773,
    "lastModifiedUser": "arn:aws:iam::123456789012:user/Mary_Major",
    "approvalRuleTemplateDescription": "All pull requests must be approved by one developer on the team.",
    "ruleContentSha256": "2f6c21a5cEXAMPLE"
  }
}
```
Untuk informasi selengkapnya, lihat [Mengelola Template Aturan Persetujuan](https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-manage-templates.html#update-template-description) di *Panduan AWS CodeCommit Pengguna*.  
+  Untuk detail API, lihat [UpdateApprovalRuleTemplateName](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/update-approval-rule-template-name.html)di *Referensi AWS CLI Perintah*. 

### `update-comment`
<a name="codecommit_UpdateComment_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`update-comment`.

**AWS CLI**  
**Untuk memperbarui komentar pada komit**  
Contoh ini menunjukkan cara menambahkan konten `"Fixed as requested. I'll update the pull request."` ke komentar dengan ID dari. `442b498bEXAMPLE5756813`  

```
aws codecommit update-comment \
    --comment-id 442b498bEXAMPLE5756813 \
    --content "Fixed as requested. I'll update the pull request."
```
Output:  

```
{
    "comment": {
        "authorArn": "arn:aws:iam::111111111111:user/Li_Juan",
        "clientRequestToken": "",
        "commentId": "442b498bEXAMPLE5756813",
        "content": "Fixed as requested. I'll update the pull request.",
        "creationDate": 1508369929.783,
        "deleted": false,
        "lastModifiedDate": 1508369929.287,
        "callerReactions": [],
        "reactionCounts":
            {
                "THUMBSUP" : 2
            }
    }
}
```
+  Untuk detail API, lihat [UpdateComment](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/update-comment.html)di *Referensi AWS CLI Perintah*. 

### `update-default-branch`
<a name="codecommit_UpdateDefaultBranch_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`update-default-branch`.

**AWS CLI**  
**Untuk mengubah cabang default untuk repositori**  
Contoh ini mengubah cabang default untuk AWS CodeCommit repositori. Perintah ini menghasilkan output hanya jika ada kesalahan.  
Perintah:  

```
aws codecommit update-default-branch --repository-name MyDemoRepo --default-branch-name MyNewBranch
```
Output:  

```
None.
```
+  Untuk detail API, lihat [UpdateDefaultBranch](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/update-default-branch.html)di *Referensi AWS CLI Perintah*. 

### `update-pull-request-approval-rule-content`
<a name="codecommit_UpdatePullRequestApprovalRuleContent_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`update-pull-request-approval-rule-content`.

**AWS CLI**  
**Untuk mengedit aturan persetujuan untuk permintaan tarik**  
`update-pull-request-approval-rule-content`Contoh berikut memperbarui dia menetapkan aturan persetujuan untuk meminta satu persetujuan pengguna dari kumpulan persetujuan yang mencakup setiap pengguna IAM dalam `123456789012` AWS akun.  

```
aws codecommit update-pull-request-approval-rule-content \
    --pull-request-id 27  \
    --approval-rule-name "Require two approved approvers" \
    --approval-rule-content "{Version: 2018-11-08, Statements: [{Type: \"Approvers\", NumberOfApprovalsNeeded: 1, ApprovalPoolMembers:[\"CodeCommitApprovers:123456789012:user/*\"]}]}}"
```
Output:  

```
{
    "approvalRule": {
        "approvalRuleContent": "{Version: 2018-11-08, Statements: [{Type: \"Approvers\", NumberOfApprovalsNeeded: 1, ApprovalPoolMembers:[\"CodeCommitApprovers:123456789012:user/*\"]}]}}",
        "approvalRuleId": "aac33506-EXAMPLE",
        "originApprovalRuleTemplate": {},
        "creationDate": 1570752871.932,
        "lastModifiedDate": 1570754058.333,
        "approvalRuleName": Require two approved approvers",
        "lastModifiedUser": "arn:aws:iam::123456789012:user/Mary_Major",
        "ruleContentSha256": "cd93921cEXAMPLE",
    }
}
```
Untuk informasi selengkapnya, lihat [Mengedit atau Menghapus Aturan Persetujuan](https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-edit-delete-pull-request-approval-rule.html#update-pull-request-approval-rule-content) di *Panduan AWS CodeCommit Pengguna*.  
+  Untuk detail API, lihat [UpdatePullRequestApprovalRuleContent](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/update-pull-request-approval-rule-content.html)di *Referensi AWS CLI Perintah*. 

### `update-pull-request-approval-state`
<a name="codecommit_UpdatePullRequestApprovalState_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`update-pull-request-approval-state`.

**AWS CLI**  
**Untuk menyetujui atau mencabut persetujuan untuk permintaan tarik**  
`update-pull-request-approval-state`Contoh berikut menyetujui permintaan tarik dengan ID `27` dan ID revisi dari. `9f29d167EXAMPLE` Jika Anda ingin mencabut persetujuan sebagai gantinya, maka tetapkan nilai `--approval-state` parameter ke. `REVOKE`  

```
aws codecommit update-pull-request-approval-state \
    --pull-request-id 27  \
    --revision-id 9f29d167EXAMPLE  \
    --approval-state "APPROVE"
```
Perintah ini tidak menghasilkan output.  
Untuk informasi selengkapnya, lihat [Meninjau Permintaan Tarik](https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-review-pull-request.html#update-pull-request-approval-state) di *Panduan AWS CodeCommit Pengguna*.  
+  Untuk detail API, lihat [UpdatePullRequestApprovalState](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/update-pull-request-approval-state.html)di *Referensi AWS CLI Perintah*. 

### `update-pull-request-description`
<a name="codecommit_UpdatePullRequestDescription_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`update-pull-request-description`.

**AWS CLI**  
**Untuk mengubah deskripsi permintaan tarik**  
Contoh ini menunjukkan bagaimana mengubah deskripsi permintaan tarik dengan ID dari. `47`  

```
aws codecommit update-pull-request-description \
    --pull-request-id 47 \
    --description "Updated the pull request to remove unused global variable."
```
Output:  

```
{
    "pullRequest": {
        "authorArn": "arn:aws:iam::111111111111:user/Li_Juan",
        "clientRequestToken": "",
        "creationDate": 1508530823.155,
        "description": "Updated the pull request to remove unused global variable.",
        "lastActivityDate": 1508372423.204,
        "pullRequestId": "47",
        "pullRequestStatus": "OPEN",
        "pullRequestTargets": [
            {
                "destinationCommit": "9f31c968EXAMPLE",
                "destinationReference": "refs/heads/main",
                "mergeMetadata": {
                    "isMerged": false,
                },
                "repositoryName": "MyDemoRepo",
                "sourceCommit": "99132ab0EXAMPLE",
                "sourceReference": "refs/heads/variables-branch"
            }
        ],
        "title": "Consolidation of global variables"
    }
}
```
+  Untuk detail API, lihat [UpdatePullRequestDescription](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/update-pull-request-description.html)di *Referensi AWS CLI Perintah*. 

### `update-pull-request-status`
<a name="codecommit_UpdatePullRequestStatus_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`update-pull-request-status`.

**AWS CLI**  
**Untuk mengubah status permintaan tarik**  
Contoh ini menunjukkan bagaimana mengubah status permintaan tarik dengan ID dari `42` ke status `CLOSED` dalam AWS CodeCommit repositori bernama. `MyDemoRepo`  

```
aws codecommit update-pull-request-status \
    --pull-request-id 42 \
    --pull-request-status CLOSED
```
Output:  

```
{
    "pullRequest": {
        "approvalRules": [
            {
                "approvalRuleContent": "{\"Version\": \"2018-11-08\",\"Statements\": [{\"Type\": \"Approvers\",\"NumberOfApprovalsNeeded\": 2,\"ApprovalPoolMembers\": [\"arn:aws:sts::123456789012:assumed-role/CodeCommitReview/*\"]}]}",
                "approvalRuleId": "dd8b17fe-EXAMPLE",
                "approvalRuleName": "2-approvers-needed-for-this-change",
                "creationDate": 1571356106.936,
                "lastModifiedDate": 571356106.936,
                "lastModifiedUser": "arn:aws:iam::123456789012:user/Mary_Major",
                "ruleContentSha256": "4711b576EXAMPLE"
            }
        ],
        "authorArn": "arn:aws:iam::123456789012:user/Li_Juan",
        "clientRequestToken": "",
        "creationDate": 1508530823.165,
        "description": "Updated the pull request to remove unused global variable.",
        "lastActivityDate": 1508372423.12,
        "pullRequestId": "47",
        "pullRequestStatus": "CLOSED",
        "pullRequestTargets": [
            {
                "destinationCommit": "9f31c968EXAMPLE",
                "destinationReference": "refs/heads/main",
                "mergeMetadata": {
                    "isMerged": false,
                },
                "repositoryName": "MyDemoRepo",
                "sourceCommit": "99132ab0EXAMPLE",
                "sourceReference": "refs/heads/variables-branch"
            }
        ],
        "title": "Consolidation of global variables"
    }
}
```
+  Untuk detail API, lihat [UpdatePullRequestStatus](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/update-pull-request-status.html)di *Referensi AWS CLI Perintah*. 

### `update-pull-request-title`
<a name="codecommit_UpdatePullRequestTitle_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`update-pull-request-title`.

**AWS CLI**  
**Untuk mengubah judul permintaan tarik**  
Contoh ini menunjukkan bagaimana mengubah judul permintaan tarik dengan ID dari. `47`  

```
aws codecommit update-pull-request-title \
    --pull-request-id 47 \
    --title "Consolidation of global variables - updated review"
```
Output:  

```
{
    "pullRequest": {
        "approvalRules": [
            {
                "approvalRuleContent": "{\"Version\": \"2018-11-08\",\"DestinationReferences\": [\"refs/heads/main\"],\"Statements\": [{\"Type\": \"Approvers\",\"NumberOfApprovalsNeeded\": 2,\"ApprovalPoolMembers\": [\"arn:aws:sts::123456789012:assumed-role/CodeCommitReview/*\"]}]}",
                "approvalRuleId": "dd8b17fe-EXAMPLE",
                "approvalRuleName": "2-approver-rule-for-main",
                "creationDate": 1571356106.936,
                "lastModifiedDate": 571356106.936,
                "lastModifiedUser": "arn:aws:iam::123456789012:user/Mary_Major",
                "originApprovalRuleTemplate": {
                    "approvalRuleTemplateId": "dd8b26gr-EXAMPLE",
                    "approvalRuleTemplateName": "2-approver-rule-for-main"
                },
                "ruleContentSha256": "4711b576EXAMPLE"
            }
        ],
        "authorArn": "arn:aws:iam::123456789012:user/Li_Juan",
        "clientRequestToken": "",
        "creationDate": 1508530823.12,
        "description": "Review the latest changes and updates to the global variables. I have updated this request with some changes, including removing some unused variables.",
        "lastActivityDate": 1508372657.188,
        "pullRequestId": "47",
        "pullRequestStatus": "OPEN",
        "pullRequestTargets": [
            {
                "destinationCommit": "9f31c968EXAMPLE",
                "destinationReference": "refs/heads/main",
                "mergeMetadata": {
                    "isMerged": false,
                },
                "repositoryName": "MyDemoRepo",
                "sourceCommit": "99132ab0EXAMPLE",
                "sourceReference": "refs/heads/variables-branch"
            }
        ],
        "title": "Consolidation of global variables - updated review"
    }
}
```
+  Untuk detail API, lihat [UpdatePullRequestTitle](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/update-pull-request-title.html)di *Referensi AWS CLI Perintah*. 

### `update-repository-description`
<a name="codecommit_UpdateRepositoryDescription_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`update-repository-description`.

**AWS CLI**  
**Untuk mengubah deskripsi untuk repositori**  
Contoh ini mengubah deskripsi untuk AWS CodeCommit repositori. Perintah ini menghasilkan output hanya jika ada kesalahan.  
Perintah:  

```
aws codecommit update-repository-description --repository-name MyDemoRepo --repository-description "This description was changed"
```
Output:  

```
None.
```
+  Untuk detail API, lihat [UpdateRepositoryDescription](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/update-repository-description.html)di *Referensi AWS CLI Perintah*. 

### `update-repository-name`
<a name="codecommit_UpdateRepositoryName_cli_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`update-repository-name`.

**AWS CLI**  
**Untuk mengubah nama repositori**  
Contoh ini mengubah nama AWS CodeCommit repositori. Perintah ini menghasilkan output hanya jika ada kesalahan. Mengubah nama AWS CodeCommit repositori akan mengubah SSH dan HTTPS URLs yang pengguna butuhkan untuk terhubung ke repositori. Pengguna tidak akan dapat terhubung ke repositori ini sampai mereka memperbarui pengaturan koneksi mereka. Selain itu, karena ARN repositori akan berubah, yang mengubah nama repositori akan membatalkan setiap kebijakan pengguna IAM yang bergantung pada ARN repositori ini.  
Perintah:  

```
aws codecommit update-repository-name --old-name MyDemoRepo --new-name MyRenamedDemoRepo
```
Output:  

```
None.
```
+  Untuk detail API, lihat [UpdateRepositoryName](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/update-repository-name.html)di *Referensi AWS CLI Perintah*. 