Git worktree manager cli. Switch Git contexts with zero friction. Review pull requests, create feature branches, and clean up your workspace. all from a single interactive CLI. Benefits developers and operations teams by streamlining Git workflows and reducing context switching.
git clone https://github.com/shutootaki/gwm.gitgwm is a CLI tool that wraps Git's worktree feature with an interactive TUI, allowing developers to work on multiple branches simultaneously without repeated stashing and checking out. It solves the friction of context switching when reviewing pull requests, handling hotfixes, or developing features in parallel by creating separate directories for each branch. Key features include fuzzy-searchable branch selection, automatic remote branch creation, merged worktree detection and cleanup, and shell integration for seamless directory navigation. The tool benefits development teams by streamlining Git workflows and reducing manual Git commands through intuitive commands like `gwm add`, `gwm go`, `gwm remove`, and `gwm clean`.
[{"step":1,"action":"Install `gwm` if not already installed. Use your package manager: `brew install gwm` (macOS), `apt install gwm` (Debian/Ubuntu), or follow the [official installation guide](https://github.com/abiosoft/gwm).","tip":"Ensure you have Git 2.23+ installed, as `gwm` relies on modern Git features like `git worktree`."},{"step":2,"action":"Navigate to your Git repository or specify the repository path in the command. Example: `cd ~/projects/my-app` or use the `--repo` flag in the prompt.","tip":"Run `gwm list` to see existing worktrees before taking action. This helps avoid conflicts or duplicate branches."},{"step":3,"action":"Use `gwm` commands to manage your workflow. Common actions include: `gwm switch [branch]`, `gwm create --pr [PR_NUMBER]`, `gwm cleanup --older-than [DAYS]`, or `gwm prune`.","tip":"For PR reviews, use `gwm create --pr [PR_NUMBER]` to automatically clone the PR into a dedicated worktree. This isolates your review environment from other branches."},{"step":4,"action":"After completing your task, clean up stale worktrees to free up disk space. Run `gwm cleanup` regularly or set up a cron job for automated cleanup.","tip":"Use `gwm prune` to remove worktrees that no longer exist on the remote (e.g., after a branch is deleted)."},{"step":5,"action":"Integrate `gwm` into your daily Git workflow. For example, pair it with `git` commands like `git status`, `git diff`, or `git log` within the worktree to maintain context.","tip":"Combine `gwm` with a terminal multiplexer like `tmux` or `zsh` to further optimize your workflow. For example, create a tmux session for each worktree."}]
Review multiple pull requests without stashing work
Create feature branches and worktrees from remote branches instantly
Switch between branches with automatic shell directory change
Clean up merged worktrees automatically
No install command available. Check the GitHub repository for manual installation instructions.
git clone https://github.com/shutootaki/gwmCopy the install command above and run it in your terminal.
Launch Claude Code, Cursor, or your preferred AI coding agent.
Use the prompt template or examples below to test the skill.
Adapt the skill to your specific use case and workflow.
Use `gwm` (Git Worktree Manager) to [ACTION] in the [REPOSITORY_PATH] repository. [ACTION] could be: 'switch to the feature branch for [ISSUE_NUMBER]', 'create a new worktree for reviewing PR #[PR_NUMBER]', 'clean up stale worktrees older than [DAYS]', or 'list all active worktrees with their associated branches'. For example: 'Use `gwm` to switch to the feature branch for issue #123 in the ~/projects/my-app repository and pull the latest changes.'
```bash $ gwm list Active worktrees in ~/projects/my-app: 1. main (HEAD detached at origin/main) - Last used: 2024-05-15 2. feature/login-page (origin/feature/login-page) - Last used: 2024-05-18 3. bugfix/header-rendering (origin/bugfix/header-rendering) - Last used: 2024-05-17 4. pr-review/456 (origin/pr/456) - Last used: 2024-05-20 $ gwm switch pr-review/456 Switched to worktree: ~/projects/my-app/pr-review/456 Current branch: pr-review/456 Last commit: Fix typo in login form (2024-05-20) ``` ```bash $ gwm cleanup --older-than 7 Found 2 stale worktrees: - bugfix/old-login-form (last used: 2024-05-10) - experimental/ui-redesign (last used: 2024-05-08) Removing bugfix/old-login-form... Done Removing experimental/ui-redesign... Done Cleanup complete. 2 worktrees removed. ``` ```bash $ gwm create --pr 789 Created new worktree at ~/projects/my-app/pr-review/789 Switched to worktree: ~/projects/my-app/pr-review/789 Cloned PR #789 (feat: add dark mode) into local branch pr-review/789 Remote: https://github.com/my-org/my-app/pull/789 ```
Free Accounting Software
IronCalc is a spreadsheet engine and ecosystem
ITIL-aligned IT service management platform
Customer feedback management made simple
Enterprise workflow automation and service management platform
Automate your spreadsheet tasks with AI power
Take a free 3-minute scan and get personalized AI skill recommendations.
Take free scan