Files
spec-kit/extensions/git
copilot-swe-agent[bot] 4f1b63a65a fix: address second round of review comments
1. Log warning on auto-install failure instead of silent catch
2. Fix README install command (--from → --dev)
3. Bash: fail fast if resolve_template/json_escape unavailable after git-common.sh fallback
4. PowerShell: fail fast if Resolve-Template unavailable after git-common.ps1 fallback
5. Fix PowerShell $env:FEATURE_DIR → $FEATURE_DIR in specify.md
6. Fix docstring to reflect already-installed return value

Co-authored-by: mnriem <15701806+mnriem@users.noreply.github.com>
Agent-Logs-Url: https://github.com/github/spec-kit/sessions/6bcb7cb8-c7da-49d6-8206-1187766f92e1
2026-03-23 22:13:37 +00:00
..

Git Branching Workflow Extension

Feature branch creation, numbering (sequential/timestamp), validation, and Git remote detection for Spec Kit.

Overview

This extension provides Git branching operations as an optional, self-contained module. It manages:

  • Feature branch creation with sequential (001-feature-name) or timestamp (20260319-143022-feature-name) numbering
  • Branch validation to ensure branches follow naming conventions
  • Git remote detection for GitHub integration (e.g., issue creation)

Commands

Command Description
speckit.git.feature Create a feature branch with sequential or timestamp numbering
speckit.git.validate Validate current branch follows feature branch naming conventions
speckit.git.remote Detect Git remote URL for GitHub integration

Hooks

Event Command Optional Description
before_specify speckit.git.feature No Create feature branch before specification
after_implement speckit.git.validate Yes Validate branch naming after implementation

Configuration

Configuration is stored in .specify/extensions/git/git-config.yml:

# Branch numbering strategy: "sequential" or "timestamp"
branch_numbering: sequential

Installation

# Install from the bundled extension directory
specify extension add extensions/git --dev

# Or it auto-installs during specify init (migration period)

Disabling

# Disable the git extension (spec creation continues without branching)
specify extension disable git

# Re-enable it
specify extension enable git

Graceful Degradation

When Git is not installed or the directory is not a Git repository:

  • Spec directories are still created under specs/
  • Branch creation is skipped with a warning
  • Branch validation is skipped with a warning
  • Remote detection returns empty results

Scripts

The extension bundles cross-platform scripts:

  • scripts/bash/create-new-feature.sh — Bash implementation
  • scripts/bash/git-common.sh — Shared Git utilities (Bash)
  • scripts/powershell/create-new-feature.ps1 — PowerShell implementation
  • scripts/powershell/git-common.ps1 — Shared Git utilities (PowerShell)