Skip to content

Instantly share code, notes, and snippets.

View sdrik's full-sized avatar

Cédric Schieli sdrik

  • Neuf-Brisach, France
View GitHub Profile
@joncardasis
joncardasis / worktrees.md
Last active September 8, 2026 18:32
Organizing Git Worktrees

Organizing Git Worktrees with Colocation

Colocated (or "bare repo + worktrees") pattern is one of the most popular and cleanest way to organize git worktrees. Here's how it works:

The Structure

myproject/              # Parent directory (not a checkout itself)
├── .bare/              # The bare git repo (the actual .git data)
├── .git                # A file (not dir) pointing to .bare