Listing the contents of a repository¶
Snowflake CLI supports the following ways to list the contents of a Git repository:
List branches in a repository¶
The snow git list-branches command lists all branches in a repository.
where:
<REPO_NAME>is the ID of the repository stage.
For example, to list all of the branches in a repository named my_snow_git, enter the following command:
List tags in a repository¶
The snow git list-tags command lists all tags in a repository.
where:
<REPO_NAME>is the ID of the repository stage.
For example, to list all of the tags in a repository named my_snow_git, enter the following command:
List files in a repository¶
The snow git list-files command lists all files at a specified repository state (a specific branch, tag, or commit).
where:
-
<REPO_PATH>is a stage path consisting of the repository name followed by a suffix that specifies the branch, tag, or commit. For example:@snowcli_git/branches/main/refers to the last commit of themainbranch.@snowcli_git/tags/v2.1.0/refers to a commit taggedv2.1.0.@snowcli_git/commits/1e939d69ca6fd0f89074e7e97c9fd1/refers to a specific commit. Commit hashes should be between 6 and 40 characters long.
A repository path can also be a subdirectory or file in the repository, but it must include a scope prefix.
The following example lists all of the files in the my_snow_git repository marked with the v2.0.0 tag:
The following example lists all of the files in the tests/ directory of the my_snow_git repository marked with the v2.0.0 tag: