# Add git integration: branch picker \+ worktrees · gitcafe/t3code

[View on GitCafe](https://git.cafe/gitcafe/t3code/commit/d64f78a9498ae017db7efde4cc5fbbfd07091a79)

Repository: [gitcafe/t3code](https://git.cafe/gitcafe/t3code)

Visibility: public

Requested revision: d64f78a9498ae017db7efde4cc5fbbfd07091a79

Requested commit: d64f78a9498ae017db7efde4cc5fbbfd07091a79

Commit: d64f78a9498ae017db7efde4cc5fbbfd07091a79

Tree: 25f7eda340cccb1538ee128625c419ce2a32551f

Author: Julius Marminge

Committer: Julius Marminge

## Message

```
Add git integration: branch picker + worktrees

Allows users to right-click "+ New thread" to create threads from specific git branches, with optional worktree creation for isolated work. Includes branch sorting (current/default first), graceful handling of non-git repos, and ability to initialize git repos.

- New git IPC contract (listBranches, createWorktree, removeWorktree, init)
- Branch context menu with worktree sub-option in Sidebar
- Thread model extended with branch/worktreePath fields
- Session cwd uses worktree path when available
- Branch sorting: current > main/master > alphabetical

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

```

## Parents

- [9023d139295fb14035424c93b9b0f30eb77e1d1d](https://git.cafe/gitcafe/t3code/commit/9023d139295fb14035424c93b9b0f30eb77e1d1d?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/t3code/tree/d64f78a9498ae017db7efde4cc5fbbfd07091a79?format=markdown)
