“I love managing stored procedures by copying text from VS Code into the Snowflake web UI,” said no one ever.
Snowflake’s Native Git Integration (GA as of late 2024/early 2025) finally solves the “Last Mile” problem of deployment. We can now connect Snowflake directly to a GitHub, GitLab, or Azure DevOps repository.
Concepts: Git Repository Stage
The core object is the Git Repository. It acts like a special Stage.
-- Create an API Integration for authentication
CREATE OR REPLACE API INTEGRATION git_api_int
API_PROVIDER = git_https_api
API_ALLOWED_PREFIXES = ('https://github.com/my-org/my-repo')
ALLOWED_AUTHENTICATION_SECRETS = (my_github_secret)
ENABLED = TRUE;
-- Create the Repository Object
CREATE OR REPLACE GIT REPOSITORY my_repo
API_INTEGRATION = git_api_int
ORIGIN = 'https://github.com/my-org/my-repo';sqlOnce created, you can “fetch” the latest code from valid branches.
ALTER GIT REPOSITORY my_repo FETCH;sqlRunning Code from Git
This is where it gets cool. You can execute scripts directly from the repo.
-- Execute a DDL script
EXECUTE IMMEDIATE FROM @my_repo/branches/main/scripts/setup_tables.sql;sqlIntegrating with Python/Snowpark
For Snowpark, this is a game changer. Instead of uploading zip files to stages manually, you can import Python modules directly from the repo.
CREATE OR REPLACE PROCEDURE my_proc()
RETURNS STRING
LANGUAGE PYTHON
RUNTIME_VERSION = 3.10
IMPORTS = ('@my_repo/branches/main/src/my_utils.py')
HANDLER = 'my_utils.run_logic';pythonA Modern CI/CD Workflow
- Developer: Pushes code to
feature/new-pipelinein GitHub. Definesdeployment.sql. - Pull Request: Code is reviewed and merged to
main. - GitHub Action (CI):
- Logs into Snowflake.
- Runs
ALTER GIT REPOSITORY my_repo FETCH. - Runs
EXECUTE IMMEDIATE FROM @my_repo/branches/main/deployment.sql.
No more third-party tools (like Schemachange or Terraform) are strictly necessary for simple deployments, although they still add value for state management. The delivery mechanism, however, is now native.
Conclusion
Native Git Integration brings Snowflake into the modern DevOps era. It creates a tightly coupled, secure link between your version control and your data platform, eliminating manual errors and “drift”.