ALTER GIT REPOSITORY¶

Modifies the properties of an existing Git repository stage.

See also:

CREATE GIT REPOSITORY, DESCRIBE GIT REPOSITORY, DROP GIT REPOSITORY, SHOW GIT BRANCHES, SHOW GIT REPOSITORIES, SHOW GIT TAGS

Syntax¶

ALTER GIT REPOSITORY <name> SET
  [ GIT_CREDENTIALS = <secret_name> ]
  [ API_INTEGRATION = <integration_name> ]
  [ COMMENT = '<string_literal>' ]

ALTER GIT REPOSITORY <name> SET TAG <tag_name> = '<tag_value>' [ , <tag_name> = '<tag_value>' ... ]

ALTER GIT REPOSITORY <name> UNSET TAG <tag_name> [ , <tag_name> ... ]

ALTER GIT REPOSITORY <name> UNSET {
  GIT_CREDENTIALS |
  COMMENT }
  [ , ... ]

ALTER GIT REPOSITORY <name> FETCH
Copy

Parameters¶

name

Specifies the identifier for the repository stage to alter.

If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive.

For more information, see Identifier requirements.

SET ...

Specifies the properties to set for the integration:

GIT_CREDENTIALS = secret_name

Specifies the secret object containing credentials for authenticating with the Git repository.

The secret you specify here must be a secret specified by the ALLOWED_AUTHENTICATION_SECRETS parameter of the API integration specified for this Git repository.

For reference information about secrets, see CREATE SECRET.

API_INTEGRATION = integration_name

Specifies the API integration containing details about how Snowflake should interact with the repository API.

For reference information about API integrations, see CREATE API INTEGRATION.

TAG tag_name = 'tag_value' [ , tag_name = 'tag_value' , ... ]

Specifies the tag name and the tag string value.

The tag value is always a string, and the maximum number of characters for the tag value is 256.

For information about specifying tags in a statement, see Tag quotas for objects and columns.

COMMENT = 'string_literal'

Specifies a comment.

Default: No value

UNSET ...

Specifies the property to unset for the integration, which resets it to the default value:

  • GIT_CREDENTIALS

  • COMMENT

To unset multiple properties or parameters with a single ALTER statement, separate each property or parameter with a comma.

When unsetting a property or parameter, specify only the property or parameter name (unless the syntax above indicates that you should specify the value). Specifying the value returns an error.

FETCH

Fetches content from the Git repository to the repository stage.

The content fetched is a full clone that fetches all branches, tags, and commits from the remote repository. The command also prunes branches and commits that were fetched earlier but no longer exist in the remote repository.

Access control requirements¶

A role used to execute this SQL command must have the following privileges at a minimum:

Privilege

Object

Notes

OWNERSHIP or WRITE

Git repository

OWNERSHIP is a special privilege on an object that is automatically granted to the role that created the object, but can also be transferred using the GRANT OWNERSHIP command to a different role by the owning role (or any role with the MANAGE GRANTS privilege).

Examples¶

The following example refreshes the snowflake_extensions repository stage with data from its Git origin:

ALTER GIT REPOSITORY snowflake_extensions FETCH;
Copy