There are more AWS SDK examples available in the AWS Doc SDK Examples
Use ListBranches with a CLI
The following code examples show how to use ListBranches.
- CLI
-
- AWS CLI
-
To view a list of branch names
This example lists all branch names in an AWS CodeCommit repository.
aws codecommit list-branches \ --repository-nameMyDemoRepoOutput:
{ "branches": [ "MyNewBranch", "main" ] }-
For API details, see ListBranches
in AWS CLI Command Reference.
-
- PowerShell
-
- Tools for PowerShell V4
-
Example 1: This example gets a list of branch names for the specified repository.
Get-CCBranchList -RepositoryName MyDemoRepoOutput:
master MyNewBranch-
For API details, see ListBranches in AWS Tools for PowerShell Cmdlet Reference (V4).
-
- Tools for PowerShell V5
-
Example 1: This example gets a list of branch names for the specified repository.
Get-CCBranchList -RepositoryName MyDemoRepoOutput:
master MyNewBranch-
For API details, see ListBranches in AWS Tools for PowerShell Cmdlet Reference (V5).
-