Skip to content

Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows

docs: cross-link Extending Worktrunk page (#2088)

Maximilian Roos7e14f811e172
diff --git a/README.md b/README.md
index a72133eb6..bed697776 100644
--- a/README.md
+++ b/README.md
@@ -208,6 +208,7 @@ The `-x` flag runs a command after switching; arguments after `--` are passed to
picker](https://worktrunk.dev/switch/#interactive-picker), [Claude Code integration](https://worktrunk.dev/claude-code/), [CI
status & PR links](https://worktrunk.dev/list/#ci-status)
- Browse [tips & patterns](https://worktrunk.dev/tips-patterns/) for recipes: aliases, dev servers, databases, agent handoffs, and more
+- [Extending Worktrunk](https://worktrunk.dev/extending/) — customize workflows with hooks & aliases
- Run `wt --help` or `wt <command> --help` for quick CLI reference
## Further reading
diff --git a/docs/content/extending.md b/docs/content/extending.md
index 1fa0ff341..e42af7ef5 100644
--- a/docs/content/extending.md
+++ b/docs/content/extending.md
@@ -106,7 +106,6 @@ See [Tips & Patterns](@/tips-patterns.md) for more recipes: dev server per workt
Aliases are custom commands invoked via `wt step <name>`. They share the same template variables and approval model as hooks.
```toml
-# .config/wt.toml
[aliases]
deploy = "make deploy BRANCH={{ branch }}"
open = "open http://localhost:{{ branch | hash_port }}"
@@ -114,6 +113,19 @@ open = "open http://localhost:{{ branch | hash_port }}"
{{ terminal(cmd="wt step deploy|||wt step deploy --dry-run|||wt step deploy --var env=staging") }}
+An `up` alias that fetches all remotes and rebases each worktree onto its upstream:
+
+```toml
+[aliases]
+up = '''
+git fetch --all --prune && wt step for-each -- '
+ git rev-parse --verify @{u} >/dev/null 2>&1 || exit 0
+ g=$(git rev-parse --git-dir)
+ test -d "$g/rebase-merge" -o -d "$g/rebase-apply" && exit 0
+ git rebase @{u} --no-autostash || git rebase --abort
+''''
+```
+
When both user and project config define the same alias name, both run — user first, then project. Project-config aliases require approval, same as project hooks.
Alias names that collide with built-in step commands (`commit`, `squash`, `rebase`, etc.) are shadowed by the built-in.
diff --git a/docs/content/worktrunk.md b/docs/content/worktrunk.md
index 9ea673899..81f3dcd20 100644
--- a/docs/content/worktrunk.md
+++ b/docs/content/worktrunk.md
@@ -202,6 +202,7 @@ The `-x` flag runs a command after switching; arguments after `--` are passed to
picker](@/switch.md#interactive-picker), [Claude Code integration](@/claude-code.md), [CI
status & PR links](@/list.md#ci-status)
- Browse [tips & patterns](@/tips-patterns.md) for recipes: aliases, dev servers, databases, agent handoffs, and more
+- [Extending Worktrunk](@/extending.md) — customize workflows with hooks & aliases
- Run `wt --help` or `wt <command> --help` for quick CLI reference
## Further reading
diff --git a/skills/worktrunk/reference/extending.md b/skills/worktrunk/reference/extending.md
index 3d4556dcc..6d6b7620e 100644
--- a/skills/worktrunk/reference/extending.md
+++ b/skills/worktrunk/reference/extending.md
@@ -99,7 +99,6 @@ See [Tips & Patterns](https://worktrunk.dev/tips-patterns/) for more recipes: de
Aliases are custom commands invoked via `wt step <name>`. They share the same template variables and approval model as hooks.
```toml
-# .config/wt.toml
[aliases]
deploy = "make deploy BRANCH={{ branch }}"
open = "open http://localhost:{{ branch | hash_port }}"
@@ -111,6 +110,19 @@ $ wt step deploy --dry-run
$ wt step deploy --var env=staging
```
+An `up` alias that fetches all remotes and rebases each worktree onto its upstream:
+
+```toml
+[aliases]
+up = '''
+git fetch --all --prune && wt step for-each -- '
+ git rev-parse --verify @{u} >/dev/null 2>&1 || exit 0
+ g=$(git rev-parse --git-dir)
+ test -d "$g/rebase-merge" -o -d "$g/rebase-apply" && exit 0
+ git rebase @{u} --no-autostash || git rebase --abort
+''''
+```
+
When both user and project config define the same alias name, both run — user first, then project. Project-config aliases require approval, same as project hooks.
Alias names that collide with built-in step commands (`commit`, `squash`, `rebase`, etc.) are shadowed by the built-in.
diff --git a/skills/worktrunk/reference/worktrunk.md b/skills/worktrunk/reference/worktrunk.md
index 0dee34400..45f30f941 100644
--- a/skills/worktrunk/reference/worktrunk.md
+++ b/skills/worktrunk/reference/worktrunk.md
@@ -184,6 +184,7 @@ The `-x` flag runs a command after switching; arguments after `--` are passed to
picker](https://worktrunk.dev/switch/#interactive-picker), [Claude Code integration](https://worktrunk.dev/claude-code/), [CI
status & PR links](https://worktrunk.dev/list/#ci-status)
- Browse [tips & patterns](https://worktrunk.dev/tips-patterns/) for recipes: aliases, dev servers, databases, agent handoffs, and more
+- [Extending Worktrunk](https://worktrunk.dev/extending/) — customize workflows with hooks & aliases
- Run `wt --help` or `wt <command> --help` for quick CLI reference
## Further reading