

Doc AWS SDK 예제 GitHub 리포지토리에서 더 많은 SDK 예제를 사용할 수 있습니다. [AWS](https://github.com/awsdocs/aws-doc-sdk-examples) 

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

# AWS SDKs를 사용한 CodeCommit 코드 예제
<a name="codecommit_code_examples"></a>

다음 코드 예제에서는 AWS 소프트웨어 개발 키트(SDK)와 AWS CodeCommit 함께를 사용하는 방법을 보여줍니다.

*작업*은 대규모 프로그램에서 발췌한 코드이며 컨텍스트에 맞춰 실행해야 합니다. 작업은 개별 서비스 함수를 직접 호출하는 방법을 보여주며, 관련 시나리오의 컨텍스트에 맞는 작업을 볼 수 있습니다.

**추가 리소스**
+  **[ CodeCommit 사용 설명서](https://docs.aws.amazon.com/codecommit/latest/userguide/welcome.html)** - CodeCommit에 대한 자세한 정보입니다.
+ **[CodeCommit API 참조](https://docs.aws.amazon.com/codecommit/latest/APIReference/Welcome.html)** - 사용 가능한 모든 CodeCommit 작업에 대한 세부 정보입니다.
+ **[AWS 개발자 센터](https://aws.amazon.com/developer/code-examples/?awsf.sdk-code-examples-product=product%23)** - 범주 또는 전체 텍스트 검색을 기준으로 필터링할 수 있는 코드 예제입니다.
+ **[AWS SDK 예제](https://github.com/awsdocs/aws-doc-sdk-examples)** - 기본 언어로 된 전체 코드가 포함된 GitHub 리포지토리. 코드 설정 및 실행을 위한 지침이 포함되어 있습니다.

**Contents**
+ [기본 사항](codecommit_code_examples_basics.md)
  + [작업](codecommit_code_examples_actions.md)
    + [`BatchGetRepositories`](codecommit_example_codecommit_BatchGetRepositories_section.md)
    + [`CreateBranch`](codecommit_example_codecommit_CreateBranch_section.md)
    + [`CreateRepository`](codecommit_example_codecommit_CreateRepository_section.md)
    + [`DeleteRepository`](codecommit_example_codecommit_DeleteRepository_section.md)
    + [`GetBranch`](codecommit_example_codecommit_GetBranch_section.md)
    + [`GetRepository`](codecommit_example_codecommit_GetRepository_section.md)
    + [`ListBranches`](codecommit_example_codecommit_ListBranches_section.md)
    + [`ListRepositories`](codecommit_example_codecommit_ListRepositories_section.md)
    + [`UpdateDefaultBranch`](codecommit_example_codecommit_UpdateDefaultBranch_section.md)
    + [`UpdateRepositoryDescription`](codecommit_example_codecommit_UpdateRepositoryDescription_section.md)
    + [`UpdateRepositoryName`](codecommit_example_codecommit_UpdateRepositoryName_section.md)

# AWS SDKs를 사용한 CodeCommit의 기본 예제
<a name="codecommit_code_examples_basics"></a>

다음 코드 예제에서는 AWS CodeCommit SDKs에서의 기본 사항을 AWS 사용하는 방법을 보여줍니다.

**Contents**
+ [작업](codecommit_code_examples_actions.md)
  + [`BatchGetRepositories`](codecommit_example_codecommit_BatchGetRepositories_section.md)
  + [`CreateBranch`](codecommit_example_codecommit_CreateBranch_section.md)
  + [`CreateRepository`](codecommit_example_codecommit_CreateRepository_section.md)
  + [`DeleteRepository`](codecommit_example_codecommit_DeleteRepository_section.md)
  + [`GetBranch`](codecommit_example_codecommit_GetBranch_section.md)
  + [`GetRepository`](codecommit_example_codecommit_GetRepository_section.md)
  + [`ListBranches`](codecommit_example_codecommit_ListBranches_section.md)
  + [`ListRepositories`](codecommit_example_codecommit_ListRepositories_section.md)
  + [`UpdateDefaultBranch`](codecommit_example_codecommit_UpdateDefaultBranch_section.md)
  + [`UpdateRepositoryDescription`](codecommit_example_codecommit_UpdateRepositoryDescription_section.md)
  + [`UpdateRepositoryName`](codecommit_example_codecommit_UpdateRepositoryName_section.md)

# AWS SDKs를 사용한 CodeCommit 작업
<a name="codecommit_code_examples_actions"></a>

다음 코드 예제에서는 AWS SDKs를 사용하여 개별 CodeCommit 작업을 수행하는 방법을 보여줍니다. 각 예시에는 GitHub에 대한 링크가 포함되어 있습니다. 여기에서 코드 설정 및 실행에 대한 지침을 찾을 수 있습니다.

 다음 예제에는 가장 일반적으로 사용되는 작업만 포함되어 있습니다. 전체 목록은 [AWS CodeCommit API 참조](https://docs.aws.amazon.com/codecommit/latest/APIReference/Welcome.html)를 참조하세요.

**Topics**
+ [`BatchGetRepositories`](codecommit_example_codecommit_BatchGetRepositories_section.md)
+ [`CreateBranch`](codecommit_example_codecommit_CreateBranch_section.md)
+ [`CreateRepository`](codecommit_example_codecommit_CreateRepository_section.md)
+ [`DeleteRepository`](codecommit_example_codecommit_DeleteRepository_section.md)
+ [`GetBranch`](codecommit_example_codecommit_GetBranch_section.md)
+ [`GetRepository`](codecommit_example_codecommit_GetRepository_section.md)
+ [`ListBranches`](codecommit_example_codecommit_ListBranches_section.md)
+ [`ListRepositories`](codecommit_example_codecommit_ListRepositories_section.md)
+ [`UpdateDefaultBranch`](codecommit_example_codecommit_UpdateDefaultBranch_section.md)
+ [`UpdateRepositoryDescription`](codecommit_example_codecommit_UpdateRepositoryDescription_section.md)
+ [`UpdateRepositoryName`](codecommit_example_codecommit_UpdateRepositoryName_section.md)

# CLI로 `BatchGetRepositories` 사용
<a name="codecommit_example_codecommit_BatchGetRepositories_section"></a>

다음 코드 예시는 `BatchGetRepositories`의 사용 방법을 보여 줍니다.

------
#### [ CLI ]

**AWS CLI**  
**여러 리포지토리에 대한 세부 정보 보기**  
이 예제에서는 multiple AWS CodeCommit 리포지토리에 대한 세부 정보를 보여줍니다.  

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

```
{
    "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": []
}
```
+  API 세부 정보는 *AWS CLI 명령 참조*의 [BatchGetRepositories](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/batch-get-repositories.html) 섹션을 참조하세요.

------
#### [ PowerShell ]

**Tools for PowerShell V4**  
**예제 1: 이 예제에서는 지정된 리포지토리 중 어떤 리포지토리를 찾을 수 있고 찾을 수 없는지 확인합니다.**  

```
Get-CCRepositoryBatch -RepositoryName MyDemoRepo, MyNewRepo, AMissingRepo
```
**출력:**  

```
Repositories                            RepositoriesNotFound
------------                            --------------------
{MyDemoRepo, MyNewRepo}                {AMissingRepo}
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V4)*의 [BatchGetRepositories](https://docs.aws.amazon.com/powershell/v4/reference)를 참조하세요.

**Tools for PowerShell V5**  
**예제 1: 이 예제에서는 지정된 리포지토리 중 어떤 리포지토리를 찾을 수 있고 찾을 수 없는지 확인합니다.**  

```
Get-CCRepositoryBatch -RepositoryName MyDemoRepo, MyNewRepo, AMissingRepo
```
**출력:**  

```
Repositories                            RepositoriesNotFound
------------                            --------------------
{MyDemoRepo, MyNewRepo}                {AMissingRepo}
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [BatchGetRepositories](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

------

# CLI로 `CreateBranch` 사용
<a name="codecommit_example_codecommit_CreateBranch_section"></a>

다음 코드 예시는 `CreateBranch`의 사용 방법을 보여 줍니다.

------
#### [ CLI ]

**AWS CLI**  
**브랜치 생성**  
이 예제에서는 a AWS CodeCommit 리포지토리에 브랜치를 생성합니다. 이 명령은 오류가 있는 경우에만 출력을 생성합니다.  
명령:  

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

```
None.
```
+  API 세부 정보는 *AWS CLI 명령 참조*의 [CreateBranch](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/create-branch.html) 섹션을 참조하세요.

------
#### [ PowerShell ]

**Tools for PowerShell V4**  
**예제 1: 이 예제에서는 지정된 리포지토리의 지정된 이름과 지정된 커밋 ID로 새 브랜치를 생성합니다.**  

```
New-CCBranch -RepositoryName MyDemoRepo -BranchName MyNewBranch -CommitId 7763222d...561fc9c9
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V4)*의 [CreateBranch](https://docs.aws.amazon.com/powershell/v4/reference)를 참조하세요.

**Tools for PowerShell V5**  
**예제 1: 이 예제에서는 지정된 리포지토리의 지정된 이름과 지정된 커밋 ID로 새 브랜치를 생성합니다.**  

```
New-CCBranch -RepositoryName MyDemoRepo -BranchName MyNewBranch -CommitId 7763222d...561fc9c9
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [CreateBranch](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

------

# CLI로 `CreateRepository` 사용
<a name="codecommit_example_codecommit_CreateRepository_section"></a>

다음 코드 예시는 `CreateRepository`의 사용 방법을 보여 줍니다.

------
#### [ CLI ]

**AWS CLI**  
**리포지토리 생성**  
이 예제에서는 리포지토리를 생성하고 사용자 AWS 계정과 연결합니다.  
명령:  

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

```
{
    "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"
    }
}
```
+  API 세부 정보는 **AWS CLI 명령 참조의 [CreateRepository](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/create-repository.html)를 참조하세요.

------
#### [ PowerShell ]

**Tools for PowerShell V4**  
**예제 1: 이 예제에서는 지정된 이름과 지정된 설명으로 새 리포지토리를 생성합니다.**  

```
New-CCRepository -RepositoryName MyDemoRepo -RepositoryDescription "This is a repository for demonstration purposes."
```
**출력:**  

```
AccountId             : 80398EXAMPLE
Arn                   : arn:aws:codecommit:us-east-1:80398EXAMPLE:MyDemoRepo
CloneUrlHttp          : https://git-codecommit.us-east-1.amazonaws.com/v1/repos/MyDemoRepo
CloneUrlSsh           : ssh://git-codecommit.us-east-1.amazonaws.com/v1/repos/MyDemoRepo
CreationDate          : 9/18/2015 4:13:25 PM
DefaultBranch         :
LastModifiedDate      : 9/18/2015 4:13:25 PM
RepositoryDescription : This is a repository for demonstration purposes.
RepositoryId          : 43ef2443-3372-4b12-9e78-65c27EXAMPLE
RepositoryName        : MyDemoRepo
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V4)*의 [CreateRepository](https://docs.aws.amazon.com/powershell/v4/reference)를 참조하세요.

**Tools for PowerShell V5**  
**예제 1: 이 예제에서는 지정된 이름과 지정된 설명으로 새 리포지토리를 생성합니다.**  

```
New-CCRepository -RepositoryName MyDemoRepo -RepositoryDescription "This is a repository for demonstration purposes."
```
**출력:**  

```
AccountId             : 80398EXAMPLE
Arn                   : arn:aws:codecommit:us-east-1:80398EXAMPLE:MyDemoRepo
CloneUrlHttp          : https://git-codecommit.us-east-1.amazonaws.com/v1/repos/MyDemoRepo
CloneUrlSsh           : ssh://git-codecommit.us-east-1.amazonaws.com/v1/repos/MyDemoRepo
CreationDate          : 9/18/2015 4:13:25 PM
DefaultBranch         :
LastModifiedDate      : 9/18/2015 4:13:25 PM
RepositoryDescription : This is a repository for demonstration purposes.
RepositoryId          : 43ef2443-3372-4b12-9e78-65c27EXAMPLE
RepositoryName        : MyDemoRepo
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [CreateRepository](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

------

# CLI로 `DeleteRepository` 사용
<a name="codecommit_example_codecommit_DeleteRepository_section"></a>

다음 코드 예시는 `DeleteRepository`의 사용 방법을 보여 줍니다.

------
#### [ CLI ]

**AWS CLI**  
**리포지토리 삭제**  
이 예제에서는 AWS CodeCommit 리포지토리를 삭제하는 방법을 보여줍니다.  
명령:  

```
aws codecommit delete-repository --repository-name MyDemoRepo
```
출력:  

```
{
  "repositoryId": "f7579e13-b83e-4027-aaef-650c0EXAMPLE"
}
```
+  API 세부 정보는 **AWS CLI 명령 참조의 [DeleteRepository](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/delete-repository.html)를 참조하세요.

------
#### [ PowerShell ]

**Tools for PowerShell V4**  
**예제 1: 이 예제에서는 지정된 리포지토리를 강제로 삭제합니다. 명령을 실행하면 계속 진행하기 전에 확인하라는 프롬프트가 표시됩니다. -Force 파라미터를 추가하여 프롬프트 없이 리포지토리를 삭제합니다.**  

```
Remove-CCRepository -RepositoryName MyDemoRepo
```
**출력:**  

```
43ef2443-3372-4b12-9e78-65c27EXAMPLE
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V4)*의 [DeleteRepository](https://docs.aws.amazon.com/powershell/v4/reference)를 참조하세요.

**Tools for PowerShell V5**  
**예제 1: 이 예제에서는 지정된 리포지토리를 강제로 삭제합니다. 명령을 실행하면 계속 진행하기 전에 확인하라는 프롬프트가 표시됩니다. -Force 파라미터를 추가하여 프롬프트 없이 리포지토리를 삭제합니다.**  

```
Remove-CCRepository -RepositoryName MyDemoRepo
```
**출력:**  

```
43ef2443-3372-4b12-9e78-65c27EXAMPLE
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [DeleteRepository](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

------

# CLI로 `GetBranch` 사용
<a name="codecommit_example_codecommit_GetBranch_section"></a>

다음 코드 예시는 `GetBranch`의 사용 방법을 보여 줍니다.

------
#### [ CLI ]

**AWS CLI**  
**커밋에 대한 정보 가져오기**  
이 예제에서는 an AWS CodeCommit 리포지토리의 브랜치에 대한 정보를 가져옵니다.  
명령:  

```
aws codecommit get-branch --repository-name MyDemoRepo --branch-name MyNewBranch
```
출력:  

```
{
  "BranchInfo": {
        "commitID": "317f8570EXAMPLE",
                "branchName": "MyNewBranch"
  }
}
```
+  API 세부 정보는 *AWS CLI 명령 참조*의 [GetBranch](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/get-branch.html) 섹션을 참조하세요.

------
#### [ PowerShell ]

**Tools for PowerShell V4**  
**예제 1: 이 예제에서는 지정된 리포지토리의 지정된 브랜치에 대한 정보를 가져옵니다.**  

```
Get-CCBranch -RepositoryName MyDemoRepo -BranchName MyNewBranch
```
**출력:**  

```
BranchName                              CommitId
----------                              --------
MyNewBranch                             7763222d...561fc9c9
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V4)*의 [GetBranch](https://docs.aws.amazon.com/powershell/v4/reference)를 참조하세요.

**Tools for PowerShell V5**  
**예제 1: 이 예제에서는 지정된 리포지토리의 지정된 브랜치에 대한 정보를 가져옵니다.**  

```
Get-CCBranch -RepositoryName MyDemoRepo -BranchName MyNewBranch
```
**출력:**  

```
BranchName                              CommitId
----------                              --------
MyNewBranch                             7763222d...561fc9c9
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [GetBranch](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

------

# CLI로 `GetRepository` 사용
<a name="codecommit_example_codecommit_GetRepository_section"></a>

다음 코드 예시는 `GetRepository`의 사용 방법을 보여 줍니다.

------
#### [ CLI ]

**AWS CLI**  
**리포지토리 관련 정보를 가져오기**  
이 예제에서는 a AWS CodeCommit 리포지토리에 대한 세부 정보를 보여줍니다.  

```
aws codecommit get-repository \
    --repository-name MyDemoRepo
```
출력:  

```
{
    "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"
    }
}
```
+  API 세부 정보는 *AWS CLI 명령 참조*의 [GetRepository](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/get-repository.html) 섹션을 참조하세요.

------
#### [ PowerShell ]

**Tools for PowerShell V4**  
**예제 1: 이 예제에서는 지정된 리포지토리에 대한 정보를 가져옵니다.**  

```
Get-CCRepository -RepositoryName MyDemoRepo
```
**출력:**  

```
AccountId             : 80398EXAMPLE
Arn                   : arn:aws:codecommit:us-east-1:80398EXAMPLE:MyDemoRepo
CloneUrlHttp          : https://git-codecommit.us-east-1.amazonaws.com/v1/repos/MyDemoRepo
CloneUrlSsh           : ssh://git-codecommit.us-east-1.amazonaws.com/v1/repos/MyDemoRepo
CreationDate          : 9/8/2015 3:21:33 PM
DefaultBranch         :
LastModifiedDate      : 9/8/2015 3:21:33 PM
RepositoryDescription : This is a repository for demonstration purposes.
RepositoryId          : c7d0d2b0-ce40-4303-b4c3-38529EXAMPLE
RepositoryName        : MyDemoRepo
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V4)*의 [GetRepository](https://docs.aws.amazon.com/powershell/v4/reference)를 참조하세요.

**Tools for PowerShell V5**  
**예제 1: 이 예제에서는 지정된 리포지토리에 대한 정보를 가져옵니다.**  

```
Get-CCRepository -RepositoryName MyDemoRepo
```
**출력:**  

```
AccountId             : 80398EXAMPLE
Arn                   : arn:aws:codecommit:us-east-1:80398EXAMPLE:MyDemoRepo
CloneUrlHttp          : https://git-codecommit.us-east-1.amazonaws.com/v1/repos/MyDemoRepo
CloneUrlSsh           : ssh://git-codecommit.us-east-1.amazonaws.com/v1/repos/MyDemoRepo
CreationDate          : 9/8/2015 3:21:33 PM
DefaultBranch         :
LastModifiedDate      : 9/8/2015 3:21:33 PM
RepositoryDescription : This is a repository for demonstration purposes.
RepositoryId          : c7d0d2b0-ce40-4303-b4c3-38529EXAMPLE
RepositoryName        : MyDemoRepo
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [GetRepository](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

------

# CLI로 `ListBranches` 사용
<a name="codecommit_example_codecommit_ListBranches_section"></a>

다음 코드 예시는 `ListBranches`의 사용 방법을 보여 줍니다.

------
#### [ CLI ]

**AWS CLI**  
**브랜치 이름 목록 보기**  
이 예제에서는 an AWS CodeCommit 리포지토리의 모든 브랜치 이름을 나열합니다.  

```
aws codecommit list-branches \
    --repository-name MyDemoRepo
```
출력:  

```
{
    "branches": [
        "MyNewBranch",
        "main"
    ]
}
```
+  API 세부 정보는 *AWS CLI 명령 참조*의 [ListBranches](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/list-branches.html) 섹션을 참조하세요.

------
#### [ PowerShell ]

**Tools for PowerShell V4**  
**예제 1: 이 예제에서는 지정된 리포지토리의 브랜치 이름 목록을 가져옵니다.**  

```
Get-CCBranchList -RepositoryName MyDemoRepo
```
**출력:**  

```
master
MyNewBranch
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V4)*의 [ListBranches](https://docs.aws.amazon.com/powershell/v4/reference)를 참조하세요.

**Tools for PowerShell V5**  
**예제 1: 이 예제에서는 지정된 리포지토리의 브랜치 이름 목록을 가져옵니다.**  

```
Get-CCBranchList -RepositoryName MyDemoRepo
```
**출력:**  

```
master
MyNewBranch
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [ListBranches](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

------

# CLI로 `ListRepositories` 사용
<a name="codecommit_example_codecommit_ListRepositories_section"></a>

다음 코드 예시는 `ListRepositories`의 사용 방법을 보여 줍니다.

------
#### [ CLI ]

**AWS CLI**  
**리포지토리의 목록 보기**  
이 예시에서는 사용자 AWS 계정과 연결된 모든 AWS CodeCommit 리포지토리를 나열합니다.  
명령:  

```
aws codecommit list-repositories
```
출력:  

```
{
  "repositories": [
      {
         "repositoryName": "MyDemoRepo"
         "repositoryId": "f7579e13-b83e-4027-aaef-650c0EXAMPLE",
      },
      {
         "repositoryName": "MyOtherDemoRepo"
         "repositoryId": "cfc29ac4-b0cb-44dc-9990-f6f51EXAMPLE"
      }
  ]
}
```
+  API 세부 정보는 *AWS CLI 명령 참조*의 [ListRepositories](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/list-repositories.html) 섹션을 참조하세요.

------
#### [ PowerShell ]

**Tools for PowerShell V4**  
**예제 1: 이 예제에서는 모든 리포지토리를 이름을 기준으로 오름차순으로 나열합니다.**  

```
Get-CCRepositoryList -Order Ascending -SortBy RepositoryName
```
**출력:**  

```
RepositoryId                            RepositoryName
------------                            --------------
c7d0d2b0-ce40-4303-b4c3-38529EXAMPLE    MyDemoRepo
05f30c66-e3e3-4f91-a0cd-1c84aEXAMPLE    MyNewRepo
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V4)*의 [ListRepositories](https://docs.aws.amazon.com/powershell/v4/reference)를 참조하세요.

**Tools for PowerShell V5**  
**예제 1: 이 예제에서는 모든 리포지토리를 이름을 기준으로 오름차순으로 나열합니다.**  

```
Get-CCRepositoryList -Order Ascending -SortBy RepositoryName
```
**출력:**  

```
RepositoryId                            RepositoryName
------------                            --------------
c7d0d2b0-ce40-4303-b4c3-38529EXAMPLE    MyDemoRepo
05f30c66-e3e3-4f91-a0cd-1c84aEXAMPLE    MyNewRepo
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [ListRepositories](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

------

# CLI로 `UpdateDefaultBranch` 사용
<a name="codecommit_example_codecommit_UpdateDefaultBranch_section"></a>

다음 코드 예시는 `UpdateDefaultBranch`의 사용 방법을 보여 줍니다.

------
#### [ CLI ]

**AWS CLI**  
**리포지토리의 기본 브랜치 변경**  
이 예제에서는 a AWS CodeCommit 리포지토리의 기본 브랜치를 변경합니다. 이 명령은 오류가 있는 경우에만 출력을 생성합니다.  
명령:  

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

```
None.
```
+  API 세부 정보는 *AWS CLI 명령 참조*의 [UpdateDefaultBranch](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/update-default-branch.html) 섹션을 참조하세요.

------
#### [ PowerShell ]

**Tools for PowerShell V4**  
**예제 1: 이 예제에서는 지정된 리포지토리의 기본 브랜치를 지정된 브랜치로 변경합니다.**  

```
Update-CCDefaultBranch -RepositoryName MyDemoRepo -DefaultBranchName MyNewBranch
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V4)*의 [UpdateDefaultBranch](https://docs.aws.amazon.com/powershell/v4/reference)를 참조하세요.

**Tools for PowerShell V5**  
**예제 1: 이 예제에서는 지정된 리포지토리의 기본 브랜치를 지정된 브랜치로 변경합니다.**  

```
Update-CCDefaultBranch -RepositoryName MyDemoRepo -DefaultBranchName MyNewBranch
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [UpdateDefaultBranch](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

------

# CLI로 `UpdateRepositoryDescription` 사용
<a name="codecommit_example_codecommit_UpdateRepositoryDescription_section"></a>

다음 코드 예시는 `UpdateRepositoryDescription`의 사용 방법을 보여 줍니다.

------
#### [ CLI ]

**AWS CLI**  
**리포지토리의 설명 변경**  
이 예제에서는 a AWS CodeCommit 리포지토리에 대한 설명을 변경합니다. 이 명령은 오류가 있는 경우에만 출력을 생성합니다.  
명령:  

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

```
None.
```
+  API 세부 정보는 *AWS CLI 명령 참조*의 [UpdateRepositoryDescription](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/update-repository-description.html) 섹션을 참조하세요.

------
#### [ PowerShell ]

**Tools for PowerShell V4**  
**예제 1: 이 예제에서는 지정된 리포지토리에 대한 설명을 변경합니다.**  

```
Update-CCRepositoryDescription -RepositoryName MyDemoRepo -RepositoryDescription "This is an updated description."
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V4)*의 [UpdateRepositoryDescription](https://docs.aws.amazon.com/powershell/v4/reference)을 참조하세요.

**Tools for PowerShell V5**  
**예제 1: 이 예제에서는 지정된 리포지토리에 대한 설명을 변경합니다.**  

```
Update-CCRepositoryDescription -RepositoryName MyDemoRepo -RepositoryDescription "This is an updated description."
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [UpdateRepositoryDescription](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.

------

# CLI로 `UpdateRepositoryName` 사용
<a name="codecommit_example_codecommit_UpdateRepositoryName_section"></a>

다음 코드 예시는 `UpdateRepositoryName`의 사용 방법을 보여 줍니다.

------
#### [ CLI ]

**AWS CLI**  
**리포지토리의 이름 변경**  
이 예제에서는 a AWS CodeCommit 리포지토리의 이름을 변경합니다. 이 명령은 오류가 있는 경우에만 출력을 생성합니다. AWS CodeCommit 리포지토리의 이름을 변경하면 사용자가 리포지토리에 연결하는 데 필요한 SSH 및 HTTPS URLs이 변경됩니다. 사용자는 연결 설정을 업데이트할 때까지 이 리포지토리에 연결할 수 없습니다. 또한 리포지토리의 ARN이 변경되므로, 리포지토리 이름을 변경하면 이 리포지토리의 ARN을 사용하는 모든 IAM 사용자 정책이 무효화됩니다.  
명령:  

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

```
None.
```
+  API 세부 정보는 *AWS CLI 명령 참조*의 [UpdateRepositoryName](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codecommit/update-repository-name.html) 섹션을 참조하세요.

------
#### [ PowerShell ]

**Tools for PowerShell V4**  
**예제 1: 이 예제에서는 지정된 리포지토리의 이름을 변경합니다.**  

```
Update-CCRepositoryName -NewName MyDemoRepo2 -OldName MyDemoRepo
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V4)*의 [UpdateRepositoryName](https://docs.aws.amazon.com/powershell/v4/reference)을 참조하세요.

**Tools for PowerShell V5**  
**예제 1: 이 예제에서는 지정된 리포지토리의 이름을 변경합니다.**  

```
Update-CCRepositoryName -NewName MyDemoRepo2 -OldName MyDemoRepo
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [UpdateRepositoryName](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.

------