Member-only story
Playing Nicely With Git Worktrees And DevContainers
Working around the “fatal: not a git repository” error
Not a Medium subscriber? Use this link to read this article for free.
The story
(skip to the solution if you’re in a hurry)
I recently read about git worktrees, and was bothered by the fact that I’ve never come across them before. I might write up my opinions on them in another article (I’m not yet convinced that I need something like tree-me), but right now I’ve managed to get devcontainers working in both my main repository and my worktree repository after a fair amount of effort, so I’m posting this before I move on.
A shout-out to the Markdown-to-Medium crew for enabling me to easily copy my solution here!
(With a couple of tweaks…









