# branchlet

> Interactive CLI tool for creating and managing Git worktrees with file copying and post-creation commands

Stars: 501 · Categories: Git

- Repository: https://github.com/raghavpillai/branchlet
- Website: https://www.npmjs.com/package/branchlet
- Page: https://www.trmn.sh/tools/branchlet

## Install

- npm: `npm install -g branchlet`

## Overview

Branchlet is a CLI tool that provides an interactive interface for managing Git worktrees. It operates through both an interactive menu system and direct commands, allowing users to create, list, and delete worktrees without manually running git worktree commands. The tool supports both interactive and non-interactive modes, making it suitable for both manual workflows and scripting.

The tool includes configuration management through project-specific `.branchlet.json` files or global settings. Key features include automatic copying of configuration files to new worktrees using glob patterns, custom post-creation commands that run in the new worktree directory, and configurable worktree path templates with variable substitution. Users can specify which files to copy and which to ignore, set up commands to run after worktree creation (like `npm install`), and configure terminal commands to automatically open editors in new worktrees.

Branchlet provides both interactive prompts and scriptable CLI flags for automation. The non-interactive mode accepts flags for worktree name (`-n`), source branch (`-s`), and new branch name (`-b`), with JSON output support for integration with other tools. The tool also supports branch deletion alongside worktree removal and includes safety checks for unpushed commits or uncommitted changes.

### Installation

```bash
# via npm
npm install -g branchlet
```

![Branchlet interactive demo](https://media.trmn.sh/cached/9ee3883edcaa7989f99471e277bcabe6e34374b0ed3fca0edd9e273fdd521271.gif)

## Alternatives

- [gitnr](https://www.trmn.sh/tools/gitnr.md): Cross-platform CLI tool for creating .gitignore files from GitHub and TopTal template collections (Rust, 239 stars)
- [ftdv](https://www.trmn.sh/tools/ftdv.md): Terminal-based diff viewer for Git with interactive file tree navigation and configurable external diff tool support. (Rust, 72 stars)
- [lazyjj](https://www.trmn.sh/tools/lazyjj.md): Terminal UI for Jujutsu version control system, providing interactive log browsing, file management, and bookmark operations (Rust, 1.2k stars)
- [serie](https://www.trmn.sh/tools/serie.md): Terminal UI for git commit graphs using image protocols to render rich visualizations in supported terminals (Rust, 2.2k stars)
- [gitu](https://www.trmn.sh/tools/gitu.md): Terminal user interface for Git inspired by Magit, providing visual staging, branching, and repository management (Rust, 2.9k stars)

---

Canonical: https://www.trmn.sh/tools/branchlet
