Small CLI to work with git bare repos and worktrees with easy-to-remember commands.
Version: 0.1.0
worktree 0.1.0
Usage
worktree <command>
Repo Commands
repo init Initialize a bare repo here and create main/
repo create <folder> Create a new bare-layout repo in <folder>/
repo clone <remote> Clone a remote into this bare-layout repo
repo convert <folder> Convert <folder>/ into <folder>/.bak + bare-layout <folder>/
repo set-remote <remote> Set or replace origin and fetch refs
repo info Alias for repo show
repo show Show repo root, origin, and branch hints
Worktree Commands
create <prefix> <description> Create a new branch worktree
create <prefix>/<description> Same as above, slash form
branch <branch> Reuse or create a worktree for an existing branch
show List registered worktrees
prune-removed-folders Prune deleted worktree folders
repair [<path>...] Repair broken worktree links
Workflows
completions <shell> Generate shell completion script
Notes
create prefixes: feature, fix, chore, hotfix
repo convert expects a clean normal repo and keeps <folder>.bak as backup
repair needs moved worktree path(s) when linked folders were relocated manually
Examples
worktree repo create EffectfulFlow
worktree repo clone git@github.com:me/EffectfulFlow.git
worktree repo convert EffectfulFlow
worktree create feature add-thing
worktree branch feature/add-thing
worktree repair
worktree repair ../mylibs/CodecMapper/mainThere's currently no prebuilt binaries, build your own and put on path...
mise run build
mise run test
dotnet publish src/Worktree/Worktree.fsproj -c Release -r linux-x64For native AOT (linux64):
mise run publish-aotBuild output is centralized under artifacts/ via the .NET SDK artifacts layout.
You can enable tab completion for your shell by adding the following to your shell configuration file.
Add this to your ~/.bashrc:
source <(worktree completions bash)Add this to your ~/.zshrc:
source <(worktree completions zsh)Add this to your ~/.config/fish/config.fish:
worktree completions fish | sourceAdd this to your $PROFILE:
Invoke-Expression (&worktree completions powershell | Out-String).NET 10is pinned in global.jsonmisemanages the local SDK via mise.toml