https://github.com/avihut/daft
Git extensions toolkit for powerful worktree management. Work on multiple branches simultaneously.
https://github.com/avihut/daft
cli developer-tools git rust worktree
Last synced: 2 days ago
JSON representation
Git extensions toolkit for powerful worktree management. Work on multiple branches simultaneously.
- Host: GitHub
- URL: https://github.com/avihut/daft
- Owner: avihut
- License: mit
- Created: 2025-05-17T22:15:41.000Z (11 months ago)
- Default Branch: master
- Last Pushed: 2026-04-20T06:20:19.000Z (7 days ago)
- Last Synced: 2026-04-20T07:26:44.286Z (7 days ago)
- Topics: cli, developer-tools, git, rust, worktree
- Language: Rust
- Size: 3.14 MB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 24
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# daft - Git Extensions Toolkit
[](https://daft.avihu.dev)
[](https://github.com/avihut/daft/actions/workflows/test.yml)
[](https://github.com/avihut/daft/releases/latest)
[](https://opensource.org/licenses/MIT)
[](https://www.rust-lang.org/)
[](https://github.com/avihut/homebrew-tap)
[](https://github.com/avihut/daft/releases)
[](https://github.com/avihut/daft/releases)
[![Windows]()](https://github.com/avihut/daft/releases)
> Stop switching branches. Work on multiple branches simultaneously.

**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
```bash
# 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:
```bash
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:
```bash
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)
```bash
brew install avihut/tap/daft
```
### Windows
```powershell
irm https://github.com/avihut/daft/releases/latest/download/daft-installer.ps1 | iex
```
### Linux / From Source
Download binaries from
[GitHub Releases](https://github.com/avihut/daft/releases/latest) or build from
source:
```bash
git clone https://github.com/avihut/daft.git
cd daft && cargo build --release
```
See [CONTRIBUTING.md](CONTRIBUTING.md) for detailed installation and symlink
setup.
### Shell Integration
Enable automatic cd into new worktrees:
```bash
# 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 ` | Clone a repo into the worktree structure |
| `git worktree-init ` | Initialize a new repo in the worktree structure |
| `git worktree-checkout ` | Create worktree from existing branch |
| `git worktree-checkout-branch ` | Create new branch + worktree |
| `git worktree-checkout-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`:
```bash
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:
```yaml
# daft.yml
hooks:
worktree-post-create:
jobs:
- name: install-deps
run: npm install
- name: direnv-allow
run: direnv allow .
```
```bash
git daft hooks trust
```
Hooks require explicit trust for security. See the
[hooks guide](https://avihu.dev/daft/guide/hooks) for details.
## AI Agent Skill
daft ships an [Agent Skill](https://github.com/anthropics/agent-skills) that
teaches AI coding agents (Claude Code, Cursor, Windsurf, and others) the
worktree workflow -- commands, hooks, environment tooling, and worktree-aware
Git operations.
```bash
npx skills add avihut/daft
```
See the [Agent Skill guide](https://avihu.dev/daft/guide/claude-skill) for
manual installation options.
## Requirements
- **Git** 2.5+ (for worktree support)
- **Rust** 1.70+ (only for building from source)
## Contributing
See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup and guidelines.
## License
MIT License - see [LICENSE](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.