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

# Auto-track Code Changes

> Connect GitHub, GitLab, or Bitbucket to automatically mark commits, tags, and releases on your API traffic charts

## What is it?

Link your git provider to ApiTraffic and every push, tag, and release is **automatically turned into an [event marker](https://docs.apitraffic.io/events.md)** on your dashboard — no CI glue required. You'll see exactly which code change lines up with a change in throughput, error rate, or latency.

![Git commit and release markers on an ApiTraffic traffic chart](https://app.apitraffic.io/images/docs/git/git-markers-on-chart.png)

## How it works

**1. Connect your provider**

An account admin links ApiTraffic to GitHub, GitLab, or Bitbucket once.

**2. Assign a repository to a bucket**

Pick a repo and the ApiTraffic bucket whose traffic it powers.

**3. Map branches to environments**

e.g. `main → Production`, `release/* → Staging`. Pushes to unmapped branches are ignored.

**4. Push code**

We receive the webhook and create an event marker on the matching bucket + environment automatically.

## Before you start

> [!NOTE]
>
> Connecting a provider and managing repositories is **admin-only** — you must be the primary user on the ApiTraffic account.

* A **GitHub**, **GitLab (gitlab.com)**, or **Bitbucket Cloud** account with admin access to the repository you want to track.
* At least one ApiTraffic **bucket** and one **environment** already created.

## Provider guides

> **[GitHub](https://docs.apitraffic.io/git-integrations/github.md)**
>
> Install the ApiTraffic GitHub App.

> **[GitLab](https://docs.apitraffic.io/git-integrations/gitlab.md)**
>
> Authorize via OAuth (gitlab.com).

> **[Bitbucket](https://docs.apitraffic.io/git-integrations/bitbucket.md)**
>
> Authorize via OAuth (Bitbucket Cloud).

## What gets tracked

| Event | Marker type | Example |
| - | - | - |
| Push to a mapped branch | `git.push` | `Pushed 3 commits to main (a1b2c3d)` |
| New tag | `git.tag` | `Tag v1.4.0` |
| Release published | `git.release` | `Release 1.4.0 (v1.4.0)` |

> [!TIP]
>
> By default each push creates **one** `git.push` marker (so a big push doesn't spam your charts). You can switch a repository to **one marker per commit** in its settings.

## Managing repositories and branch mappings

Once connected, go to **Settings → Integrations → Git** to assign repositories and edit branch mappings at any time.

![Git integration settings showing connections, repositories, and branch mappings](https://app.apitraffic.io/images/docs/git/git-settings-overview.png)

## Troubleshooting

> **I pushed but no marker appeared**
>
> The branch is probably not mapped to an environment. Only pushes to mapped branches create markers — check the branch mapping table for the repository.

> **My connection shows "Reconnect needed"**
>
> The provider access token expired or was revoked. Click **Reconnect** to re-authorize.

> **Too many markers on my chart**
>
> Turn off **one marker per commit** for the repository so each push produces a single `git.push` marker.


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