Using git worktree for A.I.-assisted coding
filiph.net·2d
🌿Git
Preview
Report Post

Filip Hráček / text /

As I’m trying to figure out the best way coding AI can help me, I’ve found one combination of tools that seems to make a lot of sense: agent workspaces and git worktree.

![](https://filiph.net/text/imgs/Screenshot 2026-01-26 at 09.54.57.png)

I’m going to document my current approach here, mostly for my own benefit. (This document started as a personal Obsidian note.) I tend to forget git invocations on a regular basis.

If you don’t know what git worktree is: it lets you put a branch’s content into a directory on your disk. So you can git worktree add some_branch some_directory, and then you can cd some_directory and work there as if it was a separate clone. Unlike a separate git clone, though, w…

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help