Skip to main content
GSD Pi manages your Git history automatically — committing after each task, isolating milestone work in branches or worktrees, and optionally creating pull requests and syncing with GitHub Issues. You control every aspect of this behavior through the git section of your PREFERENCES.md file.

Git Preferences

Add or edit the git block in ~/.gsd/PREFERENCES.md (global) or .gsd/PREFERENCES.md (project-level):

Setting Reference

The most consequential git setting. Choose how GSD isolates each milestone’s work:
See the Worktrees guide for full details on each mode.
Controls whether GSD squashes all milestone commits into one clean commit on main, or preserves the individual commit history:
When enabled, GSD creates snapshot commits during long-running tasks so work-in-progress is preserved even if the session is interrupted.
Snapshot commits use a wip: prefix and are squashed away when the milestone completes.
Controls whether GSD commits .gsd/ planning files (milestones, roadmaps, decisions, etc.) to git alongside code.
Set to false to keep all planning artifacts local-only. GSD will add .gsd/ to .gitignore automatically. Useful for teams where only some members use GSD, or when company policy requires a clean repository.
When enabled (the default), GSD automatically updates .gitignore with its baseline patterns and removes stale entries during self-healing.

Automatic Pull Requests

GSD can create a pull request automatically when a milestone completes. This is designed for teams using branch-based workflows where code goes through PR review before merging.
Automatic PR creation requires the gh CLI to be installed and authenticated (gh auth login). PR creation failure is non-fatal — GSD logs a warning and continues.

Manual PR Creation

Create a PR from inside a GSD session at any time with /gsd ship:
Use /gsd closeout to finalize a milestone and run any remaining git closeout actions:

GitHub Integration

GSD can sync milestones, slices, and tasks to GitHub Issues, Milestones, and Projects automatically. Enable and configure it in PREFERENCES.md:
GitHub integration requires the gh CLI installed and authenticated. Sync mapping is persisted in .gsd/.github-sync.json. GSD is rate-limit aware and skips sync automatically when the GitHub API limit is low.

GitHub Sync Commands

Workflow Modes

Instead of configuring every git setting individually, set a mode to apply sensible defaults for your workflow:
Any explicit preference you set overrides the mode default. Switch modes interactively with /gsd mode.

Commit Format

GSD writes commits using the conventional commit format with unit metadata in trailers. Per-task commits carry a GSD-Task trailer; milestone-closeout commits created by interactive gsd_complete_milestone carry a GSD-Unit trailer that names the closed milestone:
See Milestone Completion in Interactive Sessions for when the milestone closeout commit is created and which notices accompany it. Override the default commit type prefix with git.commit_type:

Self-Healing Git Issues

GSD automatically recovers from common Git problems:

Stale lock files

Removes .git/index.lock only after it’s older than 5 minutes, so active git operations on large repos aren’t interrupted.

Interrupted operations

Aborts leftover rebase, cherry-pick, or revert state from a killed worker before reconciling merge state.

Orphaned worktrees

Detects and offers to clean up abandoned worktrees from crashed sessions.

Unsafe branch resets

Refuses to force-reset a milestone branch if doing so would orphan commits unreachable from the start point.
Run /gsd doctor to check Git health manually and surface any issues that need attention.