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.
Before you migrate
Section titled “Before you migrate”- Commit or stash any work-in-progress on the current branch.
- Make sure your remote is set up (
git remote -vshould list at leastorigin). - Close any IDE/editor windows pointing at the old checkout path — the folder will move.
Migration steps
Section titled “Migration steps”- In Birch Code, open the menu Repository → Migrate to worktrees…
- Pick your existing repo folder.
- Confirm the target parent directory. By default, Birch Code creates
<parent>/<repo-name>/and moves the existing checkout into<parent>/<repo-name>/<current-branch>/. - Click Migrate.
What happens internally:
- The repo’s
.gitis 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.
After migration
Section titled “After migration”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).
Rolling back
Section titled “Rolling back”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:
mv <parent>/.bare-backup <repo-folder>/.git