

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

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

# 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)를 참조하세요.

------