-
-
Notifications
You must be signed in to change notification settings - Fork 0
FAQ
Common questions about git-adr and Architecture Decision Records.
An ADR is a short document that captures a significant decision made during a project, along with the context and consequences of that decision.
Each ADR answers three fundamental questions:
- What was the situation? (Context)
- What did we decide? (Decision)
- What happens because of this decision? (Consequences)
Traditional ADR tools (like adr-tools) store decisions as files in your repository. git-adr stores them in git notes, which provides several advantages:
| Feature | File-based | git-adr |
|---|---|---|
| Repository clutter | Files visible in tree | No files in working tree |
| Merge conflicts | Possible on sequential numbering | Rare (content-based IDs) |
| Commit association | Manual | Built-in linking |
| Search | Grep on files | Native search command |
| Portable | Part of repo | Part of git history |
Yes. git notes are a standard git feature supported by:
- GitHub
- GitLab
- Bitbucket
- Azure DevOps
- Self-hosted git servers
The wiki sync feature specifically supports GitHub and GitLab wikis.
Python 3.11 or higher is required. Check your version:
python --version# Basic installation
pip install git-adr
# With AI features
pip install "git-adr[ai]"
# With wiki sync
pip install "git-adr[wiki]"
# All features
pip install "git-adr[all]"For macOS, Homebrew is recommended:
brew tap zircote/git-adr
brew install git-adrgit adr init configures your repository for ADR tracking:
- Creates the initial ADR documenting use of ADRs
- Configures git to sync notes with remote
- Sets up rebase-safe note handling
Without init, notes won't sync to/from remote automatically.
Yes! Use the import command:
git adr import ./docs/architecture/decisions/This imports existing ADRs into git notes. The original files remain unchanged.
git adr new "Use PostgreSQL for primary database"This opens your editor with a template. Fill in the sections and save.
# List all
git adr list
# Filter by status
git adr list --status accepted
# Filter by tags
git adr list --tags databasegit adr edit <adr-id>Example:
git adr edit 20250115-use-postgresqlEither edit the ADR and change the status field:
git adr edit 20250115-use-postgresql
# Change status: proposed -> status: acceptedOr use the status flag:
git adr edit 20250115-use-postgresql --status acceptedWhen replacing a decision with a new one:
git adr supersede 20250115-use-mysql "Migrate to PostgreSQL"This automatically:
- Creates a new ADR
- Marks the old ADR as superseded
- Links the two ADRs
git adr rm <adr-id>
# Skip confirmation
git adr rm <adr-id> --forceNote: This removes the ADR from git notes. Recovery is possible via git reflog but requires git expertise.
# Push your ADRs
git adr sync push
# Pull team's ADRs
git adr sync pull
# Both at once
git adr syncGit notes are not pushed by default. Either:
-
Use git adr sync:
git adr sync push -
Check init was run:
git adr initconfigures automatic sync -
Manual configuration:
git config --add remote.origin.fetch '+refs/notes/*:refs/notes/*' git config --add remote.origin.push 'refs/notes/*'
git-adr uses union merge by default, which combines conflicting changes. If you need different behavior:
# Prefer local changes
git adr sync pull --merge-strategy ours
# Prefer remote changes
git adr sync pull --merge-strategy theirsYes. Each user configures their own editor:
git adr config set --global adr.editor "code --wait"This is stored in the user's global git config, not the repository.
| Template | Best For |
|---|---|
| MADR (default) | Most decisions - structured option analysis |
| Nygard | Quick, simple decisions |
| Y-Statement | Rapid documentation |
| Business | Decisions needing stakeholder approval |
| Planguage | Performance/quality targets |
| Alexandrian | Design patterns |
See ADR Templates for detailed comparisons.
# Repository-wide
git adr config set adr.template nygard
# Single ADR override
git adr new "My Decision" --template businessYes. Place template files in:
-
.git-adr/templates/your-format.md(repository) -
~/.config/git-adr/templates/your-format.md(user)
See ADR Templates#custom-templates for details.
No. AI features are optional and enhance the experience but aren't required. git-adr works fully without them.
| Provider | Best For |
|---|---|
| OpenAI | Highest quality, widely supported |
| Anthropic | Strong alternative, good for technical content |
| Ollama | Local/private, no API costs |
| Good integration if already using GCP |
Use Ollama for local processing:
git adr config set adr.ai.provider ollama
git adr config set adr.ai.model mistral
ollama serve # Start local serverNo data leaves your machine.
AI drafts are starting points, not final documents. Always:
- Review the generated content
- Edit for accuracy
- Add specific details the AI doesn't know
- Remove any hallucinated content
The installation may not be in your PATH. Try:
# Check if installed
pip show git-adr
# Use full path
python -m git_adr --help
# Add to PATH (if using pip --user)
export PATH="$HOME/.local/bin:$PATH"Either:
- No ADRs have been created:
git adr init - Notes haven't been synced:
git adr sync pull - Using wrong namespace:
git adr config get adr.namespace
Set your editor explicitly:
git adr config set --global adr.editor vim
# For GUI editors, use --wait flag
git adr config set --global adr.editor "code --wait"Check:
- Remote is configured:
git remote -v - You have push access to the remote
- Notes refs are configured:
git config --get-all remote.origin.fetch
If notes were lost, check reflog:
git notes --ref=adr logTo prevent future loss, ensure git adr init was run, which configures:
notes.rewriteRefnotes.rewrite.rebase
Write an ADR when the decision is:
- Significant - Affects architecture or design
- Structural - Changes how components interact
- Hard to reverse - Would take significant effort to undo
Don't write ADRs for:
- Code style choices (use linters)
- Library version bumps
- Bug fixes
- Trivial implementation details
Typically 1-2 pages. If longer, consider:
- Splitting into multiple decisions
- Linking to separate design documents
- Using a more concise template
Generally no. ADRs are point-in-time records. Instead:
- Decision changed? Create a superseding ADR
- Decision no longer relevant? Mark as deprecated
- Minor typo? Fix it, but don't change substance
Recommended sync points:
- After creating/accepting an ADR
- Before team meetings
- Before and after releases
- When starting work after a break
Yes. adr-tools stores ADRs as numbered markdown files:
git adr import ./doc/adr/ --pattern "*.md"Any markdown file with standard ADR structure. The import command attempts to parse:
- Title from heading
- Status from status section
- Date from filename or content
- Other sections as-is
Yes:
git adr export --output ./docs/adrs --format markdown- Getting Started - Initial setup guide
- Commands Reference - All commands
- Configuration Guide - Configuration options
- ADR Templates - Template formats
Architecture Decisions
...and 24 more