> ## Documentation Index
> Fetch the complete documentation index at: https://docs.graphify.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> The PyPI package is graphifyy, with two y's. The command is graphify.
> /graphify . is typed in an assistant chat, not in a shell.
> Use only commands, flags, and endpoints shown on these pages. Do not invent one.
> Choose the surface before you open a page. Local (Graphify Local) is the graphifyy package on the machine: the skill, the CLI, and the ten-tool MCP. Its pages are the Open Source tab (/open-source/) and the Graphify Local tab on each Integrations page. Graphify is the hosted workspace and https://api.graphify.com/mcp (Streamable HTTP, OAuth, no API key). Its pages are the Graphify tab (/platform/, /concepts/) and the Graphify (hosted) tab on each Integrations page. Prefer Graphify unless the user asks for a local or offline setup. Cookbooks (/cookbooks/) and /mcp/docs-search apply to both. Each page's source frontmatter records this as surface: local, cloud, or both. Buildkite is the CI integration.
> In llms.txt, tell the surface from the page path. Graphify: /platform/ and /concepts/. Local: /open-source/. Most /integrations/ pages cover both, with a Graphify (hosted) tab and a Graphify Local tab. Everything else applies to both.
> graphifyy release notes are published at https://github.com/Graphify-Labs/graphify/releases and https://graphify.com/changelog. The current package version is on PyPI (https://pypi.org/project/graphifyy/).
> The official site is https://graphify.com. These docs are https://docs.graphify.com.
> The local MCP server is the ten tools in the MCP tool reference and reads a graph on the machine. The hosted server is https://api.graphify.com/mcp (Streamable HTTP, OAuth, no API key). The JetBrains, ChatGPT, Codex, and Dots, and Vercel pages use the hosted server, not the ten-tool list. On pages with tabs, the Graphify (hosted) tab uses the hosted server and the Graphify Local tab uses the local skill or the ten-tool server.
> Read https://docs.graphify.com/llms.txt, then open one page's .md link. Use https://docs.graphify.com/llms-full.txt only when one page is not enough.

# Share a code graph with your team using git

> Share one code graph with your team: commit graph.json, register Graphify's git merge driver so branches merge cleanly, and tag who added each source.

To share a code graph with your team, commit `graphify-out/graph.json` and let git merge it with Graphify's union merge driver instead of as text. Every clone then starts with the same map, and two branches that both changed the graph merge without a conflict. This recipe sets that up and adds attribution for sources teammates add.

## What you'll build

* A committed `graph.json` that matches each commit's code.
* A `.gitattributes` rule and a merge driver so merges union the graph.
* A pre-commit hook that rebuilds and stages the graph.
* Tagged sources, so you know who added which document.

## Setup

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
uv tool install graphifyy
cd your-repo
graphify extract . --code-only
```

## Step 1: Track only the graph

Other files in `graphify-out/` are rebuilt locally. Track just the graph. In `.gitignore`:

```gitignore theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
graphify-out/*
!graphify-out/graph.json
```

Review the graph before the first commit. It holds names and paths taken from your source.

## Step 2: Mark the graph and register the merge driver

In `.gitattributes`:

```gitattributes theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
graphify-out/graph.json merge=graphify linguist-generated=true -diff
```

`linguist-generated=true` collapses the file in GitHub pull requests. `-diff` keeps it out of `git diff`. `merge=graphify` names the driver.

Register the driver in each clone. `graphify hook install` does this too, but `graphify hook uninstall` removes it again along with the `.gitattributes` entry, so with the pre-commit hook in Step 3 register it by hand: point it at the Python that Graphify runs in, so merges also work in GUI git clients where `graphify` isn't on `PATH`.

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
PY="$(sed -n '1s/^#!//p' "$(command -v graphify)")"
git config merge.graphify.name "graphify graph.json union merge"
git config merge.graphify.driver "\"$PY\" -m graphify merge-driver %O %A %B"
```

The driver takes the base, current and other versions, writes the union of nodes and edges back to the current file, and exits 1 on a corrupt or oversized graph so git shows a conflict instead of accepting it.

## Step 3: Rebuild before each commit

`graphify hook install` rebuilds after each commit, which leaves the rebuilt graph as an uncommitted change. If you commit the graph, use a pre-commit hook instead. Add this to `.git/hooks/pre-commit` (with `#!/bin/sh` first and `chmod +x`):

```sh theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
# graphify: rebuild graphify-out/graph.json and commit it with the code that changed it.
if [ "${GRAPHIFY_SKIP_HOOK:-0}" != 1 ] && [ -f graphify-out/graph.json ] &&
	! git diff --cached --quiet -- . ':!graphify-out/graph.json'; then
	{ PYTHONHASHSEED=0 graphify update . && git add graphify-out/graph.json; } || exit 1
fi
```

`PYTHONHASHSEED=0` keeps clustering deterministic, so community ids don't churn between machines.

## Step 4: Merge two graphs by hand

When you need to combine graphs outside git, for example from two services:

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
graphify merge-graphs service-a/graphify-out/graph.json service-b/graphify-out/graph.json --out merged.json
```

```text theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
Merged 2 graphs -> 19673 nodes, 44511 edges
```

For a standing cross-repo graph, use `graphify global add graphify-out/graph.json --as my-service` in each repository, then `graphify global list`.

## Step 5: Tag who added a source

When teammates add docs, papers or pages to the graph, record who added them:

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
graphify add https://example.com/design-notes --author "Ada" --contributor "Lin"
```

`add` saves the page to `./raw` and updates the graph. The saved file's frontmatter records the contributor (falling back to the author), so the graph can trace each source back to a person.

## When it goes wrong

**A merge stops with a conflict in `graph.json`.** The driver isn't registered in this clone, or it rejected a corrupt file. Check `git config merge.graphify.driver`. To recover, rebuild:

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
rm graphify-out/graph.json && graphify update . && git add graphify-out/graph.json
```

**Every commit shows a huge graph diff.** Since Graphify 0.9.86, `graph.json` is one line of compact JSON, so a rebuilt graph shows as one changed line. Upgrade if you see more.

**CI commits fail the hook.** Install Graphify in CI, or set `GRAPHIFY_SKIP_HOOK=1` for those commits.

## Production patterns

* Commit hooks in `.githooks/` and run `git config core.hooksPath .githooks` in each clone so everyone shares them.
* Run `graphify update .` after a branch switch to refresh the untracked report and HTML.
* In Graphify, the hosted product, the graph lives on our servers and every teammate's agent reads the same one over MCP. There's nothing to commit.

## Complete example

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
graphify extract . --code-only
printf 'graphify-out/*\n!graphify-out/graph.json\n' >> .gitignore
echo 'graphify-out/graph.json merge=graphify linguist-generated=true -diff' >> .gitattributes
PY="$(sed -n '1s/^#!//p' "$(command -v graphify)")"
git config merge.graphify.name "graphify graph.json union merge"
git config merge.graphify.driver "\"$PY\" -m graphify merge-driver %O %A %B"
# add the pre-commit hook from Step 3
git add .gitignore .gitattributes graphify-out/graph.json
git commit -m "Share the code graph"
```

## What you built

Your team shares one graph through git. It merges without conflicts, rebuilds with each commit, and records who added each source.

## Next steps

> **[Team workflows](https://docs.graphify.com/guides/team-workflows.md)**
>
> The full reference for committing and merging the graph.

> **[Keep docs in sync](https://docs.graphify.com/cookbooks/keep-docs-in-sync.md)**
>
> Rebuild the graph and wiki on every commit.

> **[Try it in Graphify](https://docs.graphify.com/platform/quickstart.md)**
>
> We build and host the graph for you. Start with a 14-day Pro trial, then keep up to 3 repositories on Free. No card required.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.