@gw-tools/gw 0.56.5 → 0.57.0-beta.56.1
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 +4 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -334,13 +334,15 @@ cp dist/packages/gw-tool/gw /usr/local/bin/gw
|
|
|
334
334
|
|
|
335
335
|
On first run, `gw` will automatically detect your git repository root and create a configuration file at `.gw/config.json`. The tool finds the config by walking up the directory tree from your current location, so you can run `gw` commands from anywhere within your repository.
|
|
336
336
|
|
|
337
|
+
**The `.gw/config.json` file is safe to commit to your repository.** It contains only portable settings — no machine-specific paths or runtime state. The `root` field has been removed; gw auto-detects the repository root from the config file location. Runtime state like cleanup timestamps is managed internally and never written to the config file.
|
|
338
|
+
|
|
337
339
|
### Auto-Detection
|
|
338
340
|
|
|
339
341
|
The tool automatically:
|
|
340
342
|
|
|
341
343
|
1. **Searches for existing config**: Walks up from your current directory looking for `.gw/config.json`
|
|
342
|
-
2. **Auto-detects git root**:
|
|
343
|
-
3. **Creates config**: Saves
|
|
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` (no machine-specific paths stored)
|
|
344
346
|
|
|
345
347
|
If auto-detection fails (rare edge cases), you can manually initialize:
|
|
346
348
|
|
|
@@ -352,7 +354,6 @@ gw init --root /path/to/your/repo.git
|
|
|
352
354
|
|
|
353
355
|
```jsonc
|
|
354
356
|
{
|
|
355
|
-
"root": "/Users/username/Workspace/my-project.git",
|
|
356
357
|
"defaultBranch": "main",
|
|
357
358
|
// Auto-copy these files when creating new worktrees
|
|
358
359
|
"autoCopyFiles": [".env", "components/agents/.env", "components/ui/.vercel/"],
|
|
@@ -365,7 +366,6 @@ gw init --root /path/to/your/repo.git
|
|
|
365
366
|
"cleanThreshold": 7,
|
|
366
367
|
"autoClean": true,
|
|
367
368
|
"updateStrategy": "merge",
|
|
368
|
-
"lastAutoCleanTime": 1706371200000, // trailing comma OK
|
|
369
369
|
}
|
|
370
370
|
```
|
|
371
371
|
|
|
@@ -375,7 +375,6 @@ gw init --root /path/to/your/repo.git
|
|
|
375
375
|
|
|
376
376
|
### Configuration Options
|
|
377
377
|
|
|
378
|
-
- **root**: Absolute path to the git repository root (automatically detected or manually set with `gw init`)
|
|
379
378
|
- **defaultBranch**: Default source worktree name (optional, defaults to "main")
|
|
380
379
|
- **autoCopyFiles**: Array of file/directory paths to automatically copy when creating worktrees with `gw checkout` (optional, only set via `gw init --auto-copy-files`)
|
|
381
380
|
- **hooks**: Command hooks configuration (optional, set via `gw init --pre-checkout` and `--post-checkout`)
|
|
@@ -384,7 +383,6 @@ gw init --root /path/to/your/repo.git
|
|
|
384
383
|
- **cleanThreshold**: Number of days before worktrees are considered stale for `gw clean` (optional, defaults to 7, set via `gw init --clean-threshold`)
|
|
385
384
|
- **autoClean**: Silently remove stale worktrees in the background when running `gw checkout` or `gw list` (optional, defaults to false, set via `gw init --auto-clean`)
|
|
386
385
|
- **updateStrategy**: Default strategy for `gw update` command: "merge" or "rebase" (optional, defaults to "merge", set via `gw init --update-strategy`)
|
|
387
|
-
- **lastAutoCleanTime**: Internal timestamp tracking last auto-cleanup run (managed automatically, do not edit manually)
|
|
388
386
|
|
|
389
387
|
## Commands
|
|
390
388
|
|
|
@@ -560,7 +558,6 @@ This creates:
|
|
|
560
558
|
|
|
561
559
|
```json
|
|
562
560
|
{
|
|
563
|
-
"root": "/path/to/repo.git",
|
|
564
561
|
"defaultBranch": "main",
|
|
565
562
|
"autoCopyFiles": [".env", "secrets/", "components/ui/.vercel/"]
|
|
566
563
|
}
|
|
@@ -1151,7 +1148,6 @@ If your `.gw/config.json` contains:
|
|
|
1151
1148
|
|
|
1152
1149
|
```json
|
|
1153
1150
|
{
|
|
1154
|
-
"root": "/Users/username/Workspace/repo.git",
|
|
1155
1151
|
"defaultBranch": "main",
|
|
1156
1152
|
"autoCopyFiles": [".env", "secrets/"],
|
|
1157
1153
|
"hooks": {
|