Configuration Reference

Complete guide to git.yaml and environment configuration for .git deployments.

v2.4.1 • Updated Dec 10, 2025

Overview

The git.yaml file is the primary configuration source for .git. It defines build commands, deployment targets, scaling rules, and monitoring behavior. The file must be placed in your repository root.

ℹ️
JSON format (git.json) is also supported. YAML is recommended for readability and inline comments.

File Structure

git.yaml
# .git config root
version: 2
app:
  name: my-service
  runtime: nodejs20
  port: 3000

build:
  command: npm run build
  cache: true
  timeout: 300 # seconds

deploy:
  regions: [us-east-1, eu-west-1, ap-south-1]
  auto_preview: true
  rollback: true

env:
  production:
    LOG_LEVEL: warn
    NODE_ENV: production

scaling:
  min_instances: 2
  max_instances: 50
  cpu_target: 70

Application Configuration

Defines runtime environment, entry points, and port binding.

ParameterTypeDefaultRequiredDescription
app.namestring-RequiredUnique service identifier. Used in URLs and logs.
app.runtimestringauto-detectOptionalRuntime: nodejs20, python3.11, go1.21, rust, docker
app.portinteger8080OptionalApplication listen port. Overridden by $PORT env var.
app.entrypointstringindex.jsOptionalCustom entry file or command override.

Build Pipeline

Controls compilation, caching, and artifact generation.

ParameterTypeDefaultRequiredDescription
build.commandstringnpm run buildOptionalShell command executed during build phase.
build.cachebooleantrueOptionalEnable layer caching for faster rebuilds.
build.timeoutinteger180OptionalMax build duration in seconds.
build.output_dirstringdist/OptionalDirectory containing production assets.

Deployment

Manages regional distribution, preview environments, and rollback behavior.

ParameterTypeDefaultRequiredDescription
deploy.regionsarray["us-east-1"]OptionalTarget edge regions. Supports global wildcard.
deploy.auto_previewbooleanfalseOptionalCreate ephemeral URLs for pull requests.
deploy.rollbackbooleantrueOptionalAutomatically revert on health check failure.
deploy.canary_percentinteger10OptionalTraffic percentage routed to new version initially.

Environment Variables

Sensitive values and runtime toggles. Managed via dashboard or config file.

⚠️
Never commit secrets to git.yaml. Use the .git dashboard or CI secrets manager.
VariableScopeDescription
.GIT_API_KEYGlobalAuthentication token for CLI and API access.
.GIT_DEPLOY_TOKENWriteTrigger deployments from external CI systems.
.GIT_LOG_LEVELRuntimeOverride config file: debug, info, warn, error
.GIT_SCALE_OVERRIDERuntimeTemporarily pin instance count (e.g., 5) for debugging.

Production Example

git.yaml
version: 2
app:
  name: payment-gateway
  runtime: go1.21
  health_check:
    path: /healthz
    interval: 15

deploy:
  regions: global
  canary_percent: 20
  rollback: true
  traffic_shaping: true

scaling:
  min_instances: 4
  max_instances: 100
  cpu_target: 65
  memory_target: 80

monitoring:
  metrics: true
  tracing: true
  logs:
    retention_days: 30
    destination: datadog

Precedence Rules

When configuration values conflict, .git resolves them in the following order (highest priority first):

  1. CLI flags (git deploy --env production)
  2. Environment variables (.GIT_*)
  3. Dashboard overrides
  4. git.yaml (repository root)
  5. Organization defaults
  6. Platform defaults