---
title: Migration & Adoption
description: Add GitKB gradually, starting with code intelligence and a small set of useful project documents.
---

# Migration & Adoption

## Start with one useful workflow

You can use code intelligence in a Git repository before creating a knowledge base:

```bash
git-kb code index --json
git-kb code symbols authenticate --json
```

To add project documents and task context, initialize a KB and your agent integration:

```bash
git-kb init
git-kb init claude   # or: git-kb init codex
```

Follow [MCP Setup](/docs/getting-started/mcp-setup/) for clients that need a separate server configuration. Then ask the agent to read the project instructions and help document a real task.

Start with the project's purpose, the architecture needed for that task, and acceptance criteria you can verify. Review the documents before committing them. The scaffold supplies workflows; it does not automatically understand or document the project.

## Bring in existing knowledge

Keep your existing issue tracker and wiki where they serve the team. Add the material you want agents to query and connect to code: architecture decisions, task criteria, incident findings, and current project context.

For a small migration, create a document, copy the relevant Markdown into its workspace file, and commit it:

```bash
git-kb create note --slug notes/auth-overview --title "Authentication overview" --json
git-kb workspace path notes/auth-overview --json
# Copy and review the material in the returned workspace file.
git-kb diff
git-kb commit -m "Add reviewed authentication overview" notes/auth-overview --json
```

Preserve source links where they help explain ownership or freshness. Check for secrets and obsolete claims as you copy material. Creating a document leaves a pending edit; the commit makes it available as committed KB knowledge.

## Build a small context set

The scaffold suggests three groups:

| Group                  | Examples                              |
| ---------------------- | ------------------------------------- |
| `context/immutable/`   | Project brief, architecture, patterns |
| `context/extensible/`  | Product context, technology choices   |
| `context/overridable/` | Current focus, progress, blockers     |

Use the groups that help your project. Keep the active context short and link to deeper documents instead of repeating them in every task.

## Roll out to the team

Use the sync URL supplied by your hosted or self-hosted KB. A GitKB.com KB has the form `https://gitkb.com/api/v1/sync/<org>/<kb>`:

```bash
git-kb remote add origin https://gitkb.com/api/v1/sync/your-org/your-kb
git-kb login origin
git-kb push origin context/
```

Commit `.kb/config.toml` to your source repository so teammates get the same remote. A teammate who clones the repository installs GitKB, creates the local store (`init` keeps the committed configuration), selects documents and converges:

```bash
git-kb init
git-kb login origin
git-kb sync select --all --remote origin   # or a narrower pattern, such as context/
git-kb sync converge origin
```

For a KB whose configuration is not in the repository, add the remote yourself and pull what you need:

```bash
git-kb init
git-kb remote add origin https://gitkb.com/api/v1/sync/your-org/your-kb
git-kb login origin
git-kb pull origin context/ --json
git-kb init claude   # or another supported harness
```

Converging or pulling brings documents into the local store. Checkout creates editable Markdown files under that worktree's `.kb/workspaces/<name>/`. Query committed documents without checking them all out, and checkout only what you need to edit.

Share repository agent guidance through your source repository. KB pull syncs KB documents; it does not distribute the scaffold's local rules, skills, or other repository files.

## Upgrading from 0.1

GitKB 1.0 migrates a 0.1 knowledge base to the Protocol 1.0 store once. Preview what the upgrade would convert without changing anything, then run it:

```bash
git-kb upgrade --report
git-kb upgrade
```

The 0.1 layout and its configuration are kept under `.kb/legacy-0.1/` with a migration report. Each `gitkb://<host>/<org>/<kb>` remote is carried to its sync URL, `https://<host>/api/v1/sync/<org>/<kb>`, and the 0.1 default remote becomes `sync.default_remote`. Other commands run on a 0.1 store also migrate it first, once. `git-kb upgrade --check` reports the store's upgrade state, and `git-kb upgrade --cleanup` deletes the kept 0.1 layout once you no longer need it.

## Next steps

- [Quick Start](/docs/getting-started/quick-start/) — A complete create-and-commit example
- [Team Collaboration](/docs/guides/team-collaboration/) — Sparse sync and conflict recovery
- [Agent Workflows](/docs/guides/agent-workflows/) — Focused context and task evidence
