@gw-tools/gw 0.61.2 → 0.62.0-beta.72.2
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 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1501,11 +1501,26 @@ gw list -v # Verbose output
|
|
|
1501
1501
|
Remove a worktree from the repository. By default, also deletes the local branch to prevent orphaned branches.
|
|
1502
1502
|
|
|
1503
1503
|
```bash
|
|
1504
|
-
gw remove <worktree
|
|
1504
|
+
gw remove <worktree...>
|
|
1505
1505
|
# or
|
|
1506
|
-
gw rm <worktree
|
|
1506
|
+
gw rm <worktree...>
|
|
1507
1507
|
```
|
|
1508
1508
|
|
|
1509
|
+
**Multiple Worktrees & Glob Patterns:**
|
|
1510
|
+
|
|
1511
|
+
You can remove several worktrees at once, either by listing them or by using a glob pattern. When more than one worktree resolves, gw shows the list and asks for confirmation before anything is removed. **Confirmation prompts default to yes** — just press Enter to proceed, or type `n` / `no` to cancel. Use `--dry-run` (or `-n`) to preview what would be removed without making any changes.
|
|
1512
|
+
|
|
1513
|
+
With shell integration installed (`eval "$(gw install-shell)"`), you can use unquoted glob patterns: `gw rm fix/*`. The integration aliases `gw` with `noglob` for zsh so the shell doesn't try to expand the pattern against the current directory first. Without integration — or in bash with non-default options like `failglob` — quote the pattern: `gw rm 'fix/*'`.
|
|
1514
|
+
|
|
1515
|
+
Supported pattern syntax:
|
|
1516
|
+
|
|
1517
|
+
- `*` — matches anything except `/`
|
|
1518
|
+
- `**` — matches anything including `/` (recursive)
|
|
1519
|
+
- `?` — matches a single character
|
|
1520
|
+
- `[abc]` — matches one of the listed characters
|
|
1521
|
+
|
|
1522
|
+
In batch mode, dirty worktrees (uncommitted or unpushed) are skipped with a warning instead of being prompted one-by-one. Use `--force` to remove them anyway. Protected branches are silently filtered out of pattern matches.
|
|
1523
|
+
|
|
1509
1524
|
**Branch Cleanup:**
|
|
1510
1525
|
|
|
1511
1526
|
By default, `gw remove` deletes the local branch after removing the worktree:
|
|
@@ -1531,6 +1546,12 @@ gw remove feat-branch # Remove worktree AND delete local bran
|
|
|
1531
1546
|
gw remove feat-branch --preserve-branch # Remove worktree but KEEP local branch
|
|
1532
1547
|
gw remove --force feat-branch # Force remove worktree and force delete branch
|
|
1533
1548
|
gw rm feat-branch # Using alias
|
|
1549
|
+
gw rm test/* # Remove all worktrees under test/ (with shell integration)
|
|
1550
|
+
gw rm 'test/*' # Same — explicit quoting if you don't have shell integration
|
|
1551
|
+
gw rm feat/* spike/* --yes # Remove every feat/* and spike/* worktree
|
|
1552
|
+
gw rm feat-a feat-b # Remove multiple worktrees by name
|
|
1553
|
+
gw rm --dry-run feat/* # Preview what would be removed (no changes)
|
|
1554
|
+
gw rm -n feat/* # Same as above using short flag
|
|
1534
1555
|
```
|
|
1535
1556
|
|
|
1536
1557
|
#### move (mv)
|