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

# Git

> Repositories, pull requests, issues, tags, releases, branches and commits across Git hosts with one API.

The Git category gives you a common view of a user’s code hosting account: their repositories, and each repository’s pull requests, issues, tags, releases, branches and commits.

**Use it to:** import a customer’s repositories, show recent pull requests in a dashboard, link commits to deploys, or read release notes, whichever Git host they use.

## Endpoints

| Endpoint | What it does |
| - | - |
| `GET /v1/git/repos` | List repositories the connection can access |
| `GET /v1/git/repos/{repo}/pulls` | List pull (merge) requests, newest first |
| `GET /v1/git/repos/{repo}/issues` | List issues |
| `GET /v1/git/repos/{repo}/tags` | List tags with their commit SHA |
| `GET /v1/git/repos/{repo}/releases` | List releases |
| `GET /v1/git/repos/{repo}/branches` | List branches with their commit SHA and protection status |
| `GET /v1/git/repos/{repo}/commits` | List commits. `branch` picks a branch, tag or SHA (default: the default branch) |

Parameters and full schemas: [Unified API reference](/docs/api-reference/unified-api). Which Git providers support which endpoints: [bundleup.io/integrations](https://www.bundleup.io/integrations).

## Identifying a repository

`{repo}` is the repository’s **`full_name`** from `GET /v1/git/repos` (for example `octocat/hello-world`), **URL-encoded** because it contains a slash:

```bash theme={null}
curl https://unify.bundleup.io/v1/git/repos/octocat%2Fhello-world/pulls \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "BU-Connection-Id: conn_abc123"
```

With the SDKs, pass `full_name` as shown in their reference. Always take `full_name` from the repos endpoint rather than building it, since its format follows the provider (GitLab namespaces can be nested, for example).

## Example: recent pull requests across all repositories

<CodeGroup>
  ```typescript JavaScript theme={null}
  const unify = client.unify('conn_abc123');

  const repos = await unify.git.repos({ limit: 20 });

  for (const repo of repos.data) {
    const pulls = await unify.git.pulls(repo.full_name, { limit: 5 });
    for (const pr of pulls.data) {
      console.log(`${repo.full_name}#${pr.number} ${pr.title} (${pr.state})`);
    }
  }
  ```

  ```python Python theme={null}
  unify = client.unify("conn_abc123")
  repos = unify.git.repos({"limit": 20})

  for repo in repos["data"]:
      pulls = unify.git.pulls(repo["full_name"], {"limit": 5})
      for pr in pulls["data"]:
          print(f'{repo["full_name"]}#{pr["number"]} {pr["title"]} ({pr["state"]})')
  ```
</CodeGroup>

Each call is one request toward the connection’s [rate limit](/docs/guides/proxy/rate-limits) of 100 per minute. For many repositories, spread the calls out.

## Response notes

* **Repository `id`** is a number on some providers and a string (UUID) on others. Treat it as opaque.
* **Pull requests** include `draft`, `state`, `user` (the author), and `merged_at` (`null` if not merged).
* **Issues** include `closed_at` (`null` if open).
* **Releases** include `tag_name`, `prerelease` and `released_at`. Not every Git host has releases.
* **Commits** include `author`, `author_email` and `committed_at`.
* **States** use the provider’s own words (`open`, `closed`, `merged`, `opened`…). Normalize them in your code if you need a fixed set.

For anything else, such as review comments, check runs or file contents, use the [Proxy](/docs/guides/proxy/overview).


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