# How to move repo state into PostgreSQL and object storage for scale-out with git-ai

Repo: [feder-cr/git-ai](https://github.com/feder-cr/git-ai) | Difficulty: Advanced | Time: 2 hours | Basis: From the README

Switch a gitai repo to a database plus object storage so any server node can be added or rebuilt.

**Who it is for:** Infrastructure engineer planning to run several gitai nodes behind one repository

**The problem:** Repository state tied to one node's disk means you cannot add nodes or recover one that dies.

**The outcome:** Your repositories are imported and served in authoritative mode from a database and object storage, with nodes acting as rebuildable caches.

## Steps

1. Read doc/graft/STORAGE.md
2. Add a [graft.storage] section to your config.toml
3. Start in shadow mode and import your repositories
4. Switch to authoritative mode once imports check out

## Prompt to paste into your agent

```text
In feder-cr/git-ai, follow doc/graft/STORAGE.md to add a [graft.storage] section using <database-url> and <object-store>, start in shadow mode and import <repo>. Verify the import completed before suggesting the switch to authoritative.
```

## Caveat

The README lists garbage collection of packs in the storage core as a known gap, so storage can grow without cleanup.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/feder-cr-git-ai/scale-repo-state-into-postgres-and-object-storage/
