Skip to content

Migrate an existing repo to worktrees

If you already have a Git repo and want to start using Birch Code’s worktree-first flow on it, you don’t need to re-clone or rewrite history. Birch Code can convert any existing checkout in place.

  • Commit or stash any work-in-progress on the current branch.
  • Make sure your remote is set up (git remote -v should list at least origin).
  • Close any IDE/editor windows pointing at the old checkout path — the folder will move.
  1. In Birch Code, open the menu Repository → Migrate to worktrees…
  2. Pick your existing repo folder.
  3. Confirm the target parent directory. By default, Birch Code creates <parent>/<repo-name>/ and moves the existing checkout into <parent>/<repo-name>/<current-branch>/.
  4. Click Migrate.

What happens internally:

  • The repo’s .git is moved to a shared bare location (<parent>/.bare/).
  • The current branch becomes a worktree under <branch>/.
  • All other local branches stay available — you can spawn worktrees for them on demand.
  • Remotes, hooks, and Git config are preserved.

Your repo paths have changed. Update:

  • IDE project paths (point to the new <branch>/ folder).
  • Any shell aliases or scripts that hardcoded the old path.
  • Git GUI tools you use alongside Birch Code (most pick up the new layout automatically).

If something goes wrong, Birch Code keeps a backup of the original .git folder in <parent>/.bare-backup/ for 30 days. You can restore the classic layout by:

Terminal window
mv <parent>/.bare-backup <repo-folder>/.git