# AI Coding Agents Finally Made Me Care About Git Worktrees

Original title: Working with Git Worktrees in Magit

> Hacker News story 49606281 · language: en · submitted 2026-09-08
> Web version: https://zeli.app/story/49606281
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 144 · by [srijan4](<https://news.ycombinator.com/user?id=srijan4>) · 💬 52
[original](<https://emacsredux.com/blog/2026/09/02/working-with-git-worktrees-in-magit/>) · [HN discussion](<https://news.ycombinator.com/item?id=49606281>)

## Summary

I ignored git worktrees for a decade, but AI coding agents like Claude Code changed that. They spin up a worktree per task so multiple agents can work on the same repo in parallel. Magit has had worktree support for years, hidden behind Z, and each worktree gets its own status buffer. I share practical tips and note that Jujutsu makes the whole problem mostly go away.

## Key quote

> What finally introduced me to worktrees was, of all things, AI coding agents.

## HN discussion (52 comments)

### [prima-facie](<https://news.ycombinator.com/item?id=49657740>)

> I use grm when I need worktrees, which makes admin a bit easier; https://github.com/hakoerber/git-repo-manager

### [simonhamp](<https://news.ycombinator.com/item?id=49655834>)

> Just use copy-on-write clones. They're way more flexible, faster and easier to reason about.
>
> I don't get spending all this time on tooling that tries to ease working with worktrees when they're just not the right abstraction for the way we're working now.

### [miggol](<https://news.ycombinator.com/item?id=49655792>)

> A slight limitation of worktrees is that you can only have a branch checked out once in all of your worktrees. I guess that's just how git works.
>
> But when I want to checkout a branch that's already checked out in another worktree, Magit just plain refuses. I wish it would offer me to either:
>
> 1. Switch to that worktree instead
>
> 2. Detach head in the other worktree and checkout here
>
> Would be such an improvement! No excuses though, I love magit and might as well hack this myself. I'm just bad at elisp.

### [brabel](<https://news.ycombinator.com/item?id=49654377>)

> As the author, I have been using worktrees due to AI agents. And I love Magit but didn’t know it handles git worktrees so well! Thanks for letting me know, will start using magit to manage my worktrees immediately.

### [hyfgfh](<https://news.ycombinator.com/item?id=49655310>)

> Sorry git worktrees are a waste of time
>
> Just keep multiple copies of the repo

---

## Cite

- Page: https://zeli.app/story/49606281
- Date: 2026-09-08
- Source: emacsredux.com (https://emacsredux.com/blog/2026/09/02/working-with-git-worktrees-in-magit/)
- Hacker News: https://news.ycombinator.com/item?id=49606281

## Other languages

- zh: https://zeli.app/zh/story/49606281 · markdown: https://zeli.app/zh/story/49606281.md
- ja: https://zeli.app/ja/story/49606281 · markdown: https://zeli.app/ja/story/49606281.md
- ko: https://zeli.app/ko/story/49606281 · markdown: https://zeli.app/ko/story/49606281.md
- de: https://zeli.app/de/story/49606281 · markdown: https://zeli.app/de/story/49606281.md
- es: https://zeli.app/es/story/49606281 · markdown: https://zeli.app/es/story/49606281.md
- ru: https://zeli.app/ru/story/49606281 · markdown: https://zeli.app/ru/story/49606281.md
