Functions§
- check_
git_ available - Check that git is available.
- default_
branch - Detect the default branch via origin/HEAD, falling back to main then master.
- delete_
branch - Delete a local branch with
git branch -d(safe delete). - fetch
- Run
git fetch --quiet. - local_
branch_ exists - Check if a local branch exists.
- remote_
branch_ exists - Check if a remote tracking branch exists (origin/
). - repo_
root - Resolve the main repository root (the common dir for worktrees).
- toplevel
- Resolve the toplevel of the current working tree (the checkout root). For the main repo this is the repo root; for a worktree it’s the worktree directory.
- worktree_
add - Add a worktree.
- worktree_
add_ new_ branch - Add a worktree with a new branch.
- worktree_
list - List worktrees. Returns list of worktree paths.
- worktree_
remove - Remove a worktree.
- worktree_
remove_ force - Force-remove a worktree (allows dirty/locked worktrees).