Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Do you use git worktree?

Avatar for みっちゃん みっちゃん
January 16, 2026
12

Do you use git worktree?

Avatar for みっちゃん

みっちゃん

January 16, 2026
Tweet

Transcript

  1. Self-introduction • Name:みっちゃん(Mitchang) • Backgrounds: ◦ Android Engineer (4 years)

    ◦ U-NEXT (since Sep 2025) ◦ DroidKaigi staff ◦ I want to be able to speak English!! X(Twitter): 🔗@mimimi_engineer 2
  2. Do you have any of these problems Code review request

    comes in while you're coding. So you want to check it in your IDE, you have to git stash the current changes… You want to fix review comments of the pull-request for Issue A, while working on Issue B at the same time While you focus on your own task, you want AI to work on another task 4
  3. What is git worktree? That’s the feature lets you use

    a single Git repository with multiple working directories !! 6
  4. ◆ Without git worktree • 1 Repo:1Working dir : 1

    branch • if you want to check out another branch → you need to stash or commit What is git worktree? 7
  5. ◆ With git worktree • You can create a separated

    directory for each branch • ex:dir A is for main branch, dir B is for feat/hoge branch What is git worktree? 8
  6. How to use git worktree git worktree add [directory for

    the branch] [branch to check out] ex:git worktree add ../PickUpConnpassEvent-2 main 9 Successfully created a worktree for the main branch of the PickUpConnpassEvent repo in the PickUpConnpassEvent-2 dir!!
  7. Pros • Open different branches of the same repository in

    separate directories, so context switching is easier (depends on the person) • Work on multiple tasks in parallel • No need to stash changes when you do a code review! 11
  8. If you want to integrate with other editors or AI

    coding tool:git-worktree-runner A CLI tool that wraps complex git worktree commands for simple management • Instantly set up isolated development environments for each branch ◦ Easily create a worktree with gtr new <branch> • Seamless integration with editors and IDEs ◦ Open a branch’s worktree in VS Code or other editors with gtr editor <branch> ◦ It’s useful for people who want to switch editors based on their task or project • Integration with AI coding tools ◦ Launch AI coding agents like Cursor in the context of a specific branch with gtr ai <branch> ◦ Let AI work on one branch while you continue your own work on another 🔗 https://zenn.dev/masajiro/articles/db0e6123492ddc 13