Skip to content

adz/worktree

Repository files navigation

worktree

Small CLI to work with git bare repos and worktrees with easy-to-remember commands.

Version: 0.1.0

Help Output

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/main

Build

There'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-x64

For native AOT (linux64):

mise run publish-aot

Build output is centralized under artifacts/ via the .NET SDK artifacts layout.

Shell Completions

You can enable tab completion for your shell by adding the following to your shell configuration file.

Bash

Add this to your ~/.bashrc:

source <(worktree completions bash)

Zsh

Add this to your ~/.zshrc:

source <(worktree completions zsh)

Fish

Add this to your ~/.config/fish/config.fish:

worktree completions fish | source

PowerShell

Add this to your $PROFILE:

Invoke-Expression (&worktree completions powershell | Out-String)

Tooling

About

CLI to manage git repos with worktrees

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages