wb-0.1.0 is not a library.
wb — git-branch interface backed by git-worktree
wb replaces the daily git branch / git checkout workflow with a worktree-based workflow. Instead of switching branches in a single working directory, each branch gets its own worktree directory. The CLI mirrors git branch flags exactly.
Bare-repo directory layout
~/projects/my-project/
.bare/ # bare git repo
.git # file: "gitdir: ./.bare"
main/ # worktree for main
feature--auth/ # worktree for feature/auth
Install
Shell integration
Add to your .zshrc:
Also supports bash and fish.
This provides:
- A
wb()shell function that handlescdinto worktrees - Tab completions
wb_current_branchprompt helper
Usage
Clone a repo into bare-repo layout
Convert an existing repo
Create a branch (+ worktree, cd into it)
List branches
Delete branches
Rename / move
Copy
Upstream tracking
Info
Configuration
Set via git config:
| Key | Default | Description |
|---|---|---|
wb.worktreeDir |
parent of .bare |
Base directory for worktrees |
wb.naming |
flat |
Naming convention: flat (/ → --), nested (/ preserved), prefixed (repo-branch) |
How it works
- All branch operations go through
git branchfor ref management - Worktree operations go through
git worktree add/remove/move - Current branch is detected by matching
cwdto worktree paths (notHEAD) - The
__wb_cd:protocol lets the binary signal the shell wrapper tocd