# GitHub

## See the code next to the card

When you connect a GitHub repository to a project, Sprintree links the pull requests, branches and commits that name a card. They show up in a **Code** section on that card, so you can see the work without leaving Sprintree. Sprintree only reads from GitHub. It never writes to your repository.

This helps AI agents too. When an agent records its work, the commits it lists are checked against what GitHub reported. See [Work records](https://sprintree.com/docs/work-records).

## Connect a repository

You need edit access to the project. GitHub must also be enabled on your Sprintree server.

1. Open the project, then **Settings**, then **Integrations**.
2. In the **Repositories** card, press **Connect GitHub**.

![The Repositories card with Connect GitHub highlighted and a connected repository](https://sprintree.com/docs-media/ai-github-repos-light-714a364c.webp)

3. GitHub opens. Choose **Only select repositories** and pick the repositories this project needs. If the Sprintree app is already installed there, save its settings and authorize Sprintree when GitHub asks.
4. Back in Sprintree, the **Choose repositories** window lists them. Tick the ones you want and press **Connect**.

A repository can be connected to several projects, up to 20. A project can hold up to 100. Private repositories cannot be connected to a public project.

## Name the card in your branch or commit

Put the card key in one of these places.

- A **branch name**, such as `WEB-123-short-name` or `feature/web-123`.
- A **pull request title**, such as `WEB-123 Fix the copy buttons`.
- The **first line of a commit message**, such as `fix: copy buttons (WEB-123)`.

The pull request description is not read. The key must stand alone, so `feature/web-123` links but `feature_web-123` does not. The match ignores case, and only your project's own key counts.

## See the code on a card

Open the card and find the **Code** section.

![A card with a Code section listing a pull request, a branch and commits](https://sprintree.com/docs-media/ai-github-code-light-881f1332.webp)

It lists the pull requests with their state (**Open**, **Draft**, **Merged**, **Closed**), the branches and the latest commits. Press a row to open it on GitHub. If a card has more commits, use **Show more**.

When you connect a repository, the commits already on its default branch from the last 90 days (up to 500) are linked too. Older pull requests are not imported. Only pull requests and branches after you connect show up.

## Disconnect a repository

In **Repositories**, press **Disconnect** next to the repository and confirm. Its pull requests, branches and commits disappear from this project's cards. You can connect it again later.

## Tips and common mistakes

- A pull request from a fork links only when its author is an owner, member or collaborator of the repository. A fork's branches are never listed.
- A repository that shows **Inaccessible** lost access on GitHub. Reconnect it from the picker.
- Sprintree does not review code. It shows pull request state, and the review itself happens on GitHub. To ask a teammate to look at a card, use **Ask for a review** in the card's properties.
- Agents can read the same list with the MCP tools `list_project_repositories` and `list_issue_commits`, and `get_issue_details` returns the code section.

## Related pages

- [Work records](https://sprintree.com/docs/work-records) for verified commits.
- [Card details](https://sprintree.com/docs/card-details) for the rest of the card.
- [Work with AI agents](https://sprintree.com/docs/work-with-ai-agents) for the big picture.
