summaryrefslogtreecommitdiff
path: root/external_plugins/bonfire/commands/git-strategy.md
blob: b8e75441811f348032b5f523b43b9ddc98fa02b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
---
description: Change how .bonfire/ is handled in git
allowed-tools: Bash(git:*), Read, Write, AskUserQuestion
model: haiku
---

# Change Git Strategy

## Step 1: Find Git Root

Run `git rev-parse --show-toplevel` to locate the repository root.

## Step 2: Read Current Config

Read `<git-root>/.bonfire/config.json` to check current `specsLocation` and `docsLocation` settings.

## Step 3: Explain Options

Present the git strategy options:

1. **Ignore all** - Keep sessions completely local
   - Everything in .bonfire/ is gitignored
   - Most private, nothing shared
   - Good for: solo work, sensitive projects

2. **Hybrid** - Commit docs/specs, keep notes private
   - docs/ and specs/ are committed
   - index.md and archive/ stay local
   - Good for: teams that want shared docs but private notes

3. **Commit all** - Share everything with team
   - All session content is committed
   - Only data/ and scratch/ ignored
   - Good for: full transparency, team continuity

## Step 4: Get User Choice

Use AskUserQuestion to ask which strategy:

"Which git strategy for `.bonfire/`?" (Header: "Git")
- ignore-all (Recommended) - Keep sessions private/local
- hybrid - Commit docs/specs, keep notes private
- commit-all - Share everything with team

## Step 5: Update .gitignore

Write the appropriate `.gitignore` to `<git-root>/.bonfire/.gitignore`:

**Ignore all**:
```
*
!.gitignore
```

**Hybrid** (only include dirs that are inside .bonfire/):
```
*
!.gitignore
```
If docsLocation is `.bonfire/docs/`, add:
```
!docs/
!docs/**
```
If specsLocation is `.bonfire/specs/`, add:
```
!specs/
!specs/**
```

**Commit all**:
```
data/
scratch/
scripts/
```

## Step 6: Handle Git Tracking

If switching FROM commit/hybrid TO ignore:
- Warn user that existing tracked files will remain tracked
- Offer to run: `git rm -r --cached .bonfire/` (removes from git but keeps files)
- They'll need to commit this change

If switching TO commit/hybrid:
- Files will be picked up on next commit
- No special action needed

## Step 7: Confirm

Report:
- New strategy applied
- Any manual steps needed
- How to verify the change