Skip to content

avihut/daft

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

322 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

daft - Git Extensions Toolkit

Docs CI Release License: MIT Rust Homebrew macOS Linux Windows

Stop switching branches. Work on multiple branches simultaneously.

daft demo

daft gives each Git branch its own directory. No more stashing, no more context switching, no more waiting for builds to restart.

my-project/
├── .git/                    # Shared Git data
├── main/                    # Stable branch
├── feature/auth/            # Your feature work
├── bugfix/login/            # Parallel bugfix
└── review/teammate-pr/      # Code review

Quick Start

# Install (macOS)
brew install avihut/tap/daft

# Clone a repo (creates my-project/main/)
git worktree-clone git@github.com:user/my-project.git

# Start a feature branch (creates my-project/feature/auth/)
git worktree-checkout-branch feature/auth

Each directory is a full working copy. Run different branches in different terminals. Your IDE state, node_modules, build artifacts - all isolated per branch.

Adopt Existing Repositories

Already have a repository? Convert it to the worktree workflow with one command:

cd my-existing-project
git worktree-flow-adopt

This restructures your repo:

my-project/                 my-project/
├── .git/                   ├── .git/        (bare repository)
├── src/           →        └── main/        (worktree)
└── README.md                   ├── src/
                                └── README.md

Your uncommitted changes are preserved. If you change your mind:

git worktree-flow-eject      # Converts back to traditional layout

Why daft?

Traditional Git workflow:

┌─────────────────────────────────────────────────────────┐
│  $ git stash                                            │
│  $ git checkout feature-b                               │
│  $ npm install        # wait...                         │
│  $ npm run build      # wait...                         │
│  # context lost, IDE state gone                         │
│  $ git checkout feature-a                               │
│  $ git stash pop                                        │
│  # where was I?                                         │
└─────────────────────────────────────────────────────────┘

With daft:

Terminal 1 (feature-a/)     Terminal 2 (feature-b/)
┌───────────────────────┐   ┌───────────────────────┐
│ $ npm run dev         │   │ $ npm run dev         │
│ Server on :3000       │   │ Server on :3001       │
│ # full context        │   │ # full context        │
└───────────────────────┘   └───────────────────────┘
         ↓                           ↓
    Both running simultaneously, isolated environments

Installation

macOS (Homebrew)

brew install avihut/tap/daft

Windows

irm https://github.com/avihut/daft/releases/latest/download/daft-installer.ps1 | iex

Linux / From Source

Download binaries from GitHub Releases or build from source:

git clone https://github.com/avihut/daft.git
cd daft && cargo build --release

See CONTRIBUTING.md for detailed installation and symlink setup.

Shell Integration

Enable automatic cd into new worktrees:

# Add to ~/.bashrc or ~/.zshrc
eval "$(daft shell-init bash)"

# Or for fish (~/.config/fish/config.fish)
daft shell-init fish | source

Commands

Command Description
git worktree-clone <url> Clone a repo into the worktree structure
git worktree-init <name> Initialize a new repo in the worktree structure
git worktree-checkout <branch> Create worktree from existing branch
git worktree-checkout-branch <branch> Create new branch + worktree
git worktree-checkout-branch <branch> main Create branch from a specific base
git worktree-prune Remove worktrees for deleted remote branches
git worktree-carry Carry uncommitted changes to other worktrees
git worktree-flow-adopt Convert traditional repo to worktree layout
git worktree-flow-eject Convert back to traditional layout

Run any command with --help for full options.

Shortcuts

Enable short aliases like gwtco, gwtcb:

daft setup shortcuts enable git    # gwtco, gwtcb, gwtprune, etc.
daft setup shortcuts list          # See all available shortcuts

Hooks

Automate worktree lifecycle events with a daft.yml configuration file:

Hook Trigger
post-clone After repository clone
worktree-post-create After worktree created
worktree-pre-remove Before worktree removal

Example - install dependencies and auto-allow direnv in new worktrees:

# daft.yml
hooks:
  worktree-post-create:
    jobs:
      - name: install-deps
        run: npm install
      - name: direnv-allow
        run: direnv allow .
git daft hooks trust

Hooks require explicit trust for security. See the hooks guide for details.

AI Agent Skill

daft ships an Agent Skill that teaches AI coding agents (Claude Code, Cursor, Windsurf, and others) the worktree workflow -- commands, hooks, environment tooling, and worktree-aware Git operations.

npx skills add avihut/daft

See the Agent Skill guide for manual installation options.

Requirements

  • Git 2.5+ (for worktree support)
  • Rust 1.70+ (only for building from source)

Contributing

See CONTRIBUTING.md for development setup and guidelines.

License

MIT License - see LICENSE for details.


Pro Tip: This workflow is powerful for frontend development, code reviews, hotfixes, and any project with complex build processes that benefit from isolation.

About

Git extensions toolkit for powerful worktree management. Work on multiple branches simultaneously.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages