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: 6 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 (9 months ago)
- Default Branch: master
- Last Pushed: 2026-01-31T13:14:50.000Z (13 days ago)
- Last Synced: 2026-02-01T01:27:26.678Z (12 days ago)
- Topics: cli, developer-tools, git, rust, worktree
- Language: Rust
- Size: 615 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 17
-
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://avihu.dev/daft)
[](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)
[-success)](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-from-default ` | Create branch from remote default |
| `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 project-managed hooks in `.daft/hooks/`:
| Hook | Trigger |
|------|---------|
| `post-clone` | After repository clone |
| `post-create` | After worktree created |
| `pre-remove` | Before worktree removal |
**Example** - auto-allow direnv in new worktrees:
```bash
mkdir -p .daft/hooks
echo '#!/bin/bash
[ -f ".envrc" ] && command -v direnv &>/dev/null && direnv allow .' > .daft/hooks/post-create
chmod +x .daft/hooks/post-create
git daft hooks trust
```
Hooks require explicit trust for security. See `git daft hooks --help` for details.
## 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.