@gw-tools/gw 0.57.0-beta.56.1 → 0.57.0-beta.56.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -342,9 +342,18 @@ The tool automatically:
|
|
|
342
342
|
|
|
343
343
|
1. **Searches for existing config**: Walks up from your current directory looking for `.gw/config.json`
|
|
344
344
|
2. **Auto-detects git root**: Derives the git root from the config file's location (or detects it if no config exists)
|
|
345
|
-
3. **Creates config**: Saves default settings to `.gw/config.json`
|
|
345
|
+
3. **Creates config**: Saves default settings to `.gw/config.json` in your worktree root
|
|
346
346
|
|
|
347
|
-
|
|
347
|
+
Config is created inside the current worktree so it can be committed to git and shared with your team. This means everyone gets the same `autoCopyFiles`, `hooks`, `defaultBranch`, etc. without each person having to configure it.
|
|
348
|
+
|
|
349
|
+
```bash
|
|
350
|
+
# Initialize and commit (one-time, from any worktree)
|
|
351
|
+
gw init --auto-copy-files .env --post-checkout "pnpm install"
|
|
352
|
+
git add .gw/config.json
|
|
353
|
+
git commit -m "chore: share gw config"
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
If auto-detection fails (rare edge cases), you can manually specify the root:
|
|
348
357
|
|
|
349
358
|
```bash
|
|
350
359
|
gw init --root /path/to/your/repo.git
|
|
@@ -375,14 +384,16 @@ gw init --root /path/to/your/repo.git
|
|
|
375
384
|
|
|
376
385
|
### Configuration Options
|
|
377
386
|
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
- **
|
|
387
|
+
All fields are optional and safe to commit — no machine-specific paths or runtime state is stored.
|
|
388
|
+
|
|
389
|
+
- **defaultBranch**: Default source worktree name (defaults to "main")
|
|
390
|
+
- **autoCopyFiles**: Array of file/directory paths to automatically copy when creating worktrees with `gw checkout` (set via `gw init --auto-copy-files`)
|
|
391
|
+
- **hooks**: Command hooks configuration (set via `gw init --pre-checkout` and `--post-checkout`)
|
|
381
392
|
- **hooks.checkout.pre**: Array of commands to run before creating a worktree
|
|
382
393
|
- **hooks.checkout.post**: Array of commands to run after creating a worktree
|
|
383
|
-
- **cleanThreshold**: Number of days before worktrees are considered stale for `gw clean` (
|
|
384
|
-
- **autoClean**: Silently remove stale worktrees in the background when running `gw checkout` or `gw list` (
|
|
385
|
-
- **updateStrategy**: Default strategy for `gw update` command: "merge" or "rebase" (
|
|
394
|
+
- **cleanThreshold**: Number of days before worktrees are considered stale for `gw clean` (defaults to 7, set via `gw init --clean-threshold`)
|
|
395
|
+
- **autoClean**: Silently remove stale worktrees in the background when running `gw checkout` or `gw list` (defaults to false, set via `gw init --auto-clean`)
|
|
396
|
+
- **updateStrategy**: Default strategy for `gw update` command: "merge" or "rebase" (defaults to "merge", set via `gw init --update-strategy`)
|
|
386
397
|
|
|
387
398
|
## Commands
|
|
388
399
|
|
|
@@ -1543,6 +1554,10 @@ gw cd feat/new-feature
|
|
|
1543
1554
|
gw init --auto-copy-files .env,components/agents/.env,components/ui/.vercel/ \
|
|
1544
1555
|
--post-checkout "pnpm install"
|
|
1545
1556
|
|
|
1557
|
+
# Commit the config so your team gets the same setup
|
|
1558
|
+
git add .gw/config.json
|
|
1559
|
+
git commit -m "chore: share gw config"
|
|
1560
|
+
|
|
1546
1561
|
# From within any worktree of your repository
|
|
1547
1562
|
# Create a new worktree with auto-copy and hooks
|
|
1548
1563
|
gw add feat/new-feature
|