Overview
Use Cases
Practical applications of Graft in development and testing workflows.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Practical applications of Graft in development and testing workflows.
# Create a clean branch before testing
graft checkout clean-state
# Run tests against the branch
pytest tests/ -n auto
# Reset for the next run
graft checkout clean-state
# On feature branch "payment-v2"
graft checkout feature-payment-v2
# Database now has the tables and data for payment-v2
# Switch back to main to investigate a bug
git checkout main
graft checkout main
# Database is back to main's state, payment-v2 changes isolated
graft commit -m "before payment_methods migration"
# Run the migration...
psql -d myapp -f migrations/20260604_add_payment_methods.sql
# Test the new feature
npm run test:e2e
# If something went wrong, roll back in seconds
graft rollback
# Seed the database
seedling generate --count 50000 --seed 42 --db "$DATABASE_URL"
# Snapshot the seeded state
graft commit -m "load test baseline (50K rows)"
# Run load test
k6 run load-test.js
# Reset to exact same state for the next run
graft checkout baseline
jobs:
test:
steps:
- uses: actions/checkout@v4
- name: Restore database state
run: graft checkout test-fixtures
- name: Run tests
run: go test ./...
graft checkout unsafe-experiment
# Drop tables, rename columns, corrupt data — it's isolated
graft verify unsafe-experiment
# ✗ Integrity FAILED — dump the experiment
graft delete unsafe-experiment
graft checkout main
# Back to safety