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

# Cross-Repo Analysis

> Catch changes that break another repository in your organization

export const ThemeImage = ({src, alt, width}) => {
  let lightSrc, darkSrc;
  if (src.includes("-light.")) {
    lightSrc = src;
    darkSrc = src.replace("-light.", "-dark.");
  } else if (src.includes("-dark.")) {
    darkSrc = src;
    lightSrc = src.replace("-dark.", "-light.");
  } else {
    lightSrc = src;
    darkSrc = src;
  }
  const style = width ? {
    maxWidth: width,
    marginInline: "auto"
  } : undefined;
  return <span>
      <img className="block dark:hidden rounded-lg border" src={lightSrc} alt={alt} style={style} />
      <img className="hidden dark:block rounded-lg border" src={darkSrc} alt={alt} style={style} />
    </span>;
};

<Note>
  Cross-Repo Analysis is available on the **Enterprise** plan.
</Note>

## Overview

Gitar checks your pull request against other repositories in your organization and reports what the change breaks in them.

Repositories are related by more than imports. A route path, an event name, or a database column that two repositories have to agree on ties them together, with no shared package between them.

<CardGroup cols={2}>
  <Card title="Automatic scanning" icon="radar">
    Every relevant repository in your organization, on every review. Nothing to link.
  </Card>

  <Card title="Unlimited repositories" icon="infinity">
    Unlimited linked repositories, discovered automatically as the organization grows.
  </Card>

  <Card title="Beyond imports" icon="route">
    A route, an event name, or an error code ties two repositories together. No shared package required.
  </Card>

  <Card title="Any code host" icon="code-branch">
    A service in a GitHub repository and a client in a GitLab repository are asserted against each other.
  </Card>
</CardGroup>

## What it catches

| The change | Impacts |
| - | - |
| <Icon icon="plug" color="#a855f7" size={16} /> A route, a wire field, an enum value, or an error code | the client still calling it or branching on the value you removed, named by repository, file, and function |
| <Icon icon="gears" color="#f59e0b" size={16} /> A shared CI action, workflow, or base image | the repositories whose builds go red on their next version bump |
| <Icon icon="code-merge" color="#3b82f6" size={16} /> Code that compiles against a symbol from another repository | that the symbol is not on that repository's default branch yet, only in an unmerged PR or an unpinned branch |
| <Icon icon="puzzle-piece" color="#ec4899" size={16} /> One side of a feature | the counterpart the other repository never got, like a UI key with no server handler or an event with no subscriber |
| <Icon icon="database" color="#10b981" size={16} /> A table, column, or file layout | the downstream job, warehouse model, or migration that has to move with it |
| <Icon icon="tag" color="#ef4444" size={16} /> A published contract, under a patch version bump | that callers auto-upgrade into the break, so it needs a major tag or a deprecation window |

## How it works

<Steps>
  <Step title="Gitar scans every repository in your organization">
    It narrows the whole organization down to the repositories your change can reach.
  </Step>

  <Step title="Gitar asserts your diff against those repositories">
    Each impact is verified against your PR before you see it.
  </Step>

  <Step title="Gitar reports what breaks and how to keep it working">
    Each finding is anchored on the line in your PR that changed the contract, names the affected repository and the file and function in it that breaks, and gives your options: keep the change backward compatible, or sequence the rollout so nothing breaks at runtime.

    A finding says which end to fix. Some are yours to hold in this PR, some are a follow-up in the other repository, and some need a change at both ends to land safely.
  </Step>
</Steps>

<Note>
  Findings are labeled **Cross-Repo** and post inline like any other [code review finding](/features/code-review).
</Note>

## Inspect Cross-repo findings

Enterprise organization members can open **Dashboard -> Cross-repo** to explore repository connections and filter findings by repository, status, or fix location. Only admins can change the feature setting.

Admins use the Cross-repo toggle on that page to turn the feature on or off. Turning it off stops future processing and retains its history.

<ThemeImage src="/assets/images/cross-repo-overview-light.png" alt="Example Cross-repo dashboard with repository connections and findings grouped by fix location" />

Select a finding to inspect the changed and affected repositories. Expand **Technical details** to see the original finding and suggested fix location.

<ThemeImage src="/assets/images/cross-repo-detail-light.png" alt="Example Cross-repo finding showing affected repositories and where to fix the breaking change" width={560} />

## Coverage

Gitar builds a summary of a repository the first time it reviews one, and refreshes it as the repository changes. Nothing to enrol, no backfill to run.

Coverage therefore builds as Gitar sees more of your organization. A review opened the day the feature is turned on may not reach everything yet.

## Repository visibility

A pull request is only ever matched against repositories its readers could already see. A private repository is matched against every repository in your organization. A public one is matched only against other public repositories, plus itself.

A public pull request therefore never surfaces a finding that names a private repository or describes its contents.

## Naming and excluding repositories

Gitar gets this right in most cases. To customize it, commit `.gitar/cross-repo.md` and describe the relationships in natural language: which repositories depend on this one, what has to stay consistent between them, and what to leave alone.

```markdown theme={null}
`my-org/frontend` and `my-org/mobile` call the API this repository publishes.
`my-org/data-jobs` reads the tables this repository owns.
Ignore `my-org/frontend-archive`.
```

Put the file in your [configuration repository](/configuration/configuration-repository) to apply it across the organization, or in a single repository to scope it there. When both exist, the organization's rules load first and the repository's file adds to them.

## Related

For interactions between related open PRs, use [Cross-PR Analysis](/features/cross-pr-analysis).

Cross-Repo Analysis checks shared contracts. [Knowledge](/features/knowledge) supplies team conventions and connected context, while [Functional Validation](/features/functional-validation) checks the requirements the PR claims to implement.

<CardGroup cols={2}>
  <Card title="Code Review" icon="magnifying-glass" href="/features/code-review">
    How findings are posted, resolved, and tracked
  </Card>

  <Card title="Insights" icon="chart-line" href="/features/insights">
    Where the Cross-Repo category is reported across your organization
  </Card>

  <Card title="The Gitar Dashboard" icon="comment" href="/gitar-dashboard">
    The comment the Code Review section lives in
  </Card>

  <Card title="Plans" icon="credit-card" href="/account-billing/plans">
    What each plan includes
  </Card>
</CardGroup>


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