DEV Community

Julio Daniel Reyes
Julio Daniel Reyes

Posted on

A Better Way to Run Git Worktrees Finally!

I recently found git-gtr, a small CLI by the CodeRabbit team that wraps native Git worktrees and makes them practical for daily use.

Repository: https://github.com/coderabbitai/git-worktree-runner

Install it, create an alias for it alias gw="git gtr" (Easier to remember, but up to you!).

  • Navigate to your repository
  • gw new <branchName> will create a new worktree. The first time it will create a new folder in the parent directory <repo>-worktrees, inside it a folder <branchName> for your newly created worktree.
  • gw editor <branchName> will open the configured code editor.
  • gw ai <branchName> will start your cli (claude, codex, opencode)
  • gw run <branchName> <command> will run commands on that worktree
  • gw rm <branchName> to remove it once you are done.

Full demo in my new vid. Would you use this? or do you prefer the original git command?

Top comments (0)