From bd4e084ab0ead3f8639acf7a2b3335e23c594c34 Mon Sep 17 00:00:00 2001 From: Benjamin Grandfond Date: Sun, 28 Sep 2025 19:57:58 +0200 Subject: [PATCH] git: add git worktree management aliases --- modules/git/README.md | 9 +++++++++ modules/git/alias.zsh | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/modules/git/README.md b/modules/git/README.md index fad57a1..833092d 100644 --- a/modules/git/README.md +++ b/modules/git/README.md @@ -323,6 +323,15 @@ zstyle ':prezto:module:git:alias' skip 'yes' - `gwX` removes files from the working tree and from the index recursively and forcefully. +### Worktree management (W) + +- `gWa` add a new working tree. +- `gWl` list all working trees. +- `gWx` removes a working tree. +- `gWX` removes a working tree and forcefully. +- `gWm` moves a working tree to a new location. +- `gWc` prunes all the working trees. + ### Shadows The following aliases may shadow system commands: diff --git a/modules/git/alias.zsh b/modules/git/alias.zsh index f14cca5..91ed53f 100644 --- a/modules/git/alias.zsh +++ b/modules/git/alias.zsh @@ -272,4 +272,12 @@ if ! zstyle -t ':prezto:module:git:alias' skip; then alias gwC='git clean --force' alias gwx='git rm -r' alias gwX='git rm -r --force' + + # Worktree management (W) + alias gWa='git worktree add' + alias gWl='git worktree list' + alias gWx='git worktree remove' + alias gWX='git worktree remove --force' + alias gWm='git worktree move' + alias gWc='git worktree prune' fi