Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nwt — New WorkTree

Instant parallel git worktrees. One command, zero ceremony.

nwt   # creates a new worktree in .worktrees/<name>

What it does

nwt is a thin bash wrapper around git worktree that lets you spin up isolated working copies of the current repo in seconds — without leaving your editor's repo root or stashing changes.

  • No-arg mode: auto-generates a wip-N branch, then prompts for a name to use for both the branch and the worktree directory.
  • Named mode: nwt -c feature/login creates the branch and worktree immediately.
  • Bulk mode: nwt -a or nwt "feature/.*" creates worktrees for many branches at once.
  • Dry run: nwt -n previews without touching anything.

Worktrees land in .worktrees/<name> inside the repo by default (configurable via WORKTREE_DIR).

Install

./install-nwt.sh

This copies git-worktree-quick into place and adds an nwt() shell function to your ~/.zshrc (or ~/.bashrc).

Manual install:

echo 'nwt() { ~/Github/nwt/git-worktree-quick "$@"; }' >> ~/.zshrc
source ~/.zshrc

Verify:

nwt -n   # dry-run preview

Usage

Command What it does
nwt Prompt for a name, create matching branch + worktree
nwt -n Dry-run preview
nwt -c feature/login Create named branch + worktree immediately
nwt -c fix/bug -f develop Branch from develop instead of HEAD
nwt -a Worktrees for ALL remote branches
nwt "feature/.*" Worktrees matching a regex
nwt -h Full help

Typical flow

cd ~/project
nwt                       # → .worktrees/login-redesign
cd .worktrees/login-redesign
code .                    # work in isolation
git push -u origin login-redesign

Run nwt again from the main repo to start another parallel experiment — they don't interfere with each other.

Files

  • git-worktree-quick — the script nwt runs
  • install-nwt.sh — installer (adds shell function)
  • git-worktree-parallel — advanced multi-worktree manager (more knobs, same idea)
  • WORKTREE_QUICK_README.md — long-form docs and examples

Requirements

  • git ≥ 2.5 (worktree support)
  • bash or zsh

About

Quick Git worktree helper for naming parallel development workspaces fast

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages