리포지토리의 내용 나열하기

Snowflake CLI 는 Git 리포지토리의 내용을 나열하는 다음과 같은 방법을 지원합니다.

리포지토리의 분기 나열

snow git list-branches 명령은 리포지토리의 모든 분기를 나열합니다.

snow git list-branches <REPO_NAME>
Copy

여기서,

  • <REPO_NAME> 은 리포지토리 스테이지의 ID입니다.

예를 들어, 이름이 my_snow_git 인 리포지토리의 모든 분기를 나열하려면 다음 명령을 입력합니다.

snow git list-branches my_snow_git
Copy
show git branches in my_snow_git
+--------------------------------------------------------------------------------------------------------------------------------------------+
| name                                     | path                                     | checkouts | commit_hash                              |
|------------------------------------------+------------------------------------------+-----------+------------------------------------------|
| SNOW-1011750-service-create-options      | /branches/SNOW-1011750-service-create-op |           | 729855df0104c8d0ef1c7a3e8f79fe50c6c8d2fa |
|                                          | tions                                    |           |                                          |
| SNOW-1011775-containers-to-spcs-int-test | /branches/SNOW-1011775-containers-to-spc |           | e81b00de6b0eb73a99a7baaa39b0afa5ea1202d0 |
| s                                        | s-int-tests                              |           |                                          |
| SNOW-1105629-git-integration-tests       | /branches/SNOW-1105629-git-integration-t |           | 712b07b5e692624c34caabe07d64801615ce5f0f |
+--------------------------------------------------------------------------------------------------------------------------------------------+

리포지토리의 태그 나열

snow git list-tabs 명령은 리포지토리에 있는 모든 태그를 나열합니다.

snow git list-tags <REPO_NAME>
Copy

여기서,

  • <REPO_NAME> 은 생성할 리포지토리 스테이지의 ID입니다. 리포지토리 스테이지가 이미 있는 경우 명령이 실패합니다.

예를 들어, 이름이 my_snow_git 인 리포지토리의 모든 태그를 나열하려면 다음 명령을 입력합니다.

snow git list-tags my_snow_git
Copy
show git tags in my_snow_git
+--------------------------------------------------------------------------------------------------------------+
| name           | path                 | commit_hash                 | author                       | message |
|----------------+----------------------+-----------------------------+------------------------------+---------|
| v2.0.0rc3      | /tags/v2.0.0rc3      | 2b019d2841da823d8001f23c6f3 | None                         | None    |
|                |                      | 064e5899142a0               |                              |         |
| v2.1.0-rc0     | /tags/v2.1.0-rc0     | 829887b758b43b86959611dd612 | None                         | None    |
|                |                      | 7638da75cf871               |                              |         |
| v2.1.0-rc1     | /tags/v2.1.0-rc1     | b7efe1fe9c0925b95ba214e233b | None                         | None    |
|                |                      | 18924fa0404b3               |                              |         |
+--------------------------------------------------------------------------------------------------------------+

리포지토리의 파일 나열

snow git list-files 명령은 지정된 리포지토리 상태(특정 분기, 태그 또는 커밋)에 있는 모든 파일을 나열합니다.

snow git list-files <REPO_PATH>
Copy

여기서,

  • <REPO_PATH> 는 특정 범위의 스테이지 경로로, 값은 리포지토리 이름 뒤에 분기, 태그 또는 커밋을 지정하는 접미사가 붙습니다. 다음은 다양한 유형의 값을 나열한 것입니다.

    • @snowcli_git/branches/main/main 분기의 마지막 커밋을 말합니다.

    • @snowcli_git/tags/v2.1.0/ 은 커밋 태그가 지정된 v2.1.0 을 말합니다.

    • @snowcli_git/commits/1e939d69ca6fd0f89074e7e97c9fd1/ 은 특정 커밋을 말합니다. 커밋 해시는 6~40자 사이여야 합니다.

    리포지토리 경로는 리포지토리의 하위 디렉터리 또는 파일일 수도 있지만, 이 경우에도 범위 접두사로 시작해야 합니다.

다음 예제에는 v2.0.0 태그가 지정된 my_snow_git 리포지토리의 모든 파일이 나열되어 있습니다.

snow git list-files @my_snow_git/tags/v2.0.0/
Copy
ls @snowcli_git/tags/v2.0.0/
+---------------------------------------------------------------------------------------------------------------------------------+
| name                                    | size | md5  | sha1                                     | last_modified                |
|-----------------------------------------+------+------+------------------------------------------+------------------------------|
| snowcli_git/tags/v2.0.0/CONTRIBUTING.md | 5472 | None | 1cc437b88d20afe4d5751bd576114e3b20be27ea | Mon, 5 Feb 2024 13:16:25 GMT |
| snowcli_git/tags/v2.0.0/LEGAL.md        | 251  | None | 4453da50b7a2222006289ff977bfb23583657214 | Mon, 5 Feb 2024 13:16:25 GMT |
| snowcli_git/tags/v2.0.0/README.md       | 1258 | None | bdc918baae93467c258c6634c872ca6bd4ee1e9c | Mon, 5 Feb 2024 13:16:25 GMT |
| snowcli_git/tags/v2.0.0/SECURITY.md     | 308  | None | 27e7e1b2fd28a86943b3f4c0a35a931577422389 | Mon, 5 Feb 2024 13:16:25 GMT |
| ...
+---------------------------------------------------------------------------------------------------------------------------------+

다음 예제는 v2.0.0 태그가 지정된 my_snow_git 리포지토리의 tests/ 디렉터리 내 모든 파일을 나열합니다.

snow git list-files @my_snow_git/tags/v2.0.0/tests --pattern ".*\.toml"
Copy
ls @snowcli_git/tags/v2.0.0/tests pattern = '.*\.toml'
+-----------------------------------------------------------------------------------------------------------------------------------------+
| name                                            | size | md5  | sha1                                     | last_modified                |
|-------------------------------------------------+------+------+------------------------------------------+------------------------------|
| snowcli_git/tags/v2.0.0/tests/empty_config.toml | 0    | None | e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 | Mon, 5 Feb 2024 13:16:25 GMT |
| snowcli_git/tags/v2.0.0/tests/test.toml         | 381  | None | 45f1c00f16eba1b7bc7b4ab2982afe95d0161e7f | Mon, 5 Feb 2024 13:16:25 GMT |
+-----------------------------------------------------------------------------------------------------------------------------------------+