Isolated environments for every worktree
Allocates unique ports, databases, and Redis namespaces per git worktree so parallel development — human or AI — never collides.
brew install git-treeline/tap/git-treeline
AI agents and parallel development mean multiple worktrees running at the same time. They all fight over port 3000, the same database, the same Redis instance. One collision kills the whole flow.
~/feature-a $ rails server
=> Booting Puma on http://localhost:3000
~/feature-b $ rails server
Address already in use - bind(2) for "127.0.0.1" port 3000 (Errno::EADDRINUSE)
Unique ports, database names, and Redis namespaces assigned per worktree. No manual coordination needed.
.treeline.yml describes what your project needs. config.json controls your machine.
status, release, prune to inspect and clean up allocations across worktrees.
~/myapp $ git worktree add ../myapp-feature-auth
Preparing worktree (new branch 'feature-auth')
~/myapp-feature-auth $ git-treeline setup .
Allocated resources for worktree myapp-feature-auth
PORT=3001 DB=myapp_dev_wt1 REDIS_NS=wt1
Wrote .env
~/myapp-feature-auth $ git-treeline status
┌──────────────────────┬──────┬─────────────────┬──────────┐
│ Worktree │ Port │ Database │ Redis │
├──────────────────────┼──────┼─────────────────┼──────────┤
│ myapp (main) │ 3000 │ myapp_dev │ default │
│ myapp-feature-auth │ 3001 │ myapp_dev_wt1 │ wt1 │
│ myapp-fix-payments │ 3002 │ myapp_dev_wt2 │ wt2 │
└──────────────────────┴──────┴─────────────────┴──────────┘
Anything that reads PORT from the environment works out of the box. Rails, Next.js, Express, FastAPI — whatever your team runs.
resources: port: range: [3000, 3099] database: template: "myapp_dev_{{.Suffix}}" redis: namespace: true
The git-treeline-rails gem automatically injects allocated environment variables into your Rails app via a Railtie. Zero config.
gem "git-treeline-rails"
AI coding agents spin up worktrees to work in parallel. Git Treeline handles resource isolation so agents don't collide with each other or with your local dev server.
$ git-treeline setup .
Allocated resources for worktree agent-task-42
$ git-treeline status --json
{
"worktree": "agent-task-42",
"port": 3003,
"database": "myapp_dev_wt3"
}
brew install git-treeline/tap/git-treeline
go install github.com/git-treeline/git-treeline@latest