gw is a simple wrapper around git worktree command. it adds a custom configuration per repository to specify the worktree path and commands to run on worktree creation.
download the binary from the releases page or install from source using the following command:
go install github.com/flexphere/gw@latestgw init \
--worktree-path ~/.worktree \ # setup current repository to create its worktrees under "~/.worktree"
--cmd "echo hello" --cmd "echo world" # run `echo hello` and `echo world` on worktree creationgw new name-of-worktreegw edit # opens the config file in the editorevery other command then above is redirected to git worktree command
gw list # executes `git worktree list`
gw prune # executes `git worktree prune`
...