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

# GitHub

> Install the Tracelit GitHub App, link a repository, map Development and Production branches, and open fix PRs from incidents.

Connect **GitHub** so Tracelit can pull source for root-cause analysis and open pull requests with proposed fixes. Nothing merges without your review.

***

## Connect GitHub

<Steps>
  <Step title="Install the Tracelit GitHub App">
    In the app, go to **Settings → Integrations → GitHub** and click **Install GitHub App**. Authorize access to the organizations and repositories you want Tracelit to use.
  </Step>

  <Step title="Link a repository">
    Select the site or service in the circle selector, open **Utilities → Repository**, and link a repo the App can access.
  </Step>

  <Step title="Map branches">
    Set **Development** and **Production** to the branches Tracelit should analyze and patch for each environment.
  </Step>

  <Step title="Enable resolution gates">
    Under **Utilities → Environment**, turn on **Allow resolutions** (and **Code analysis** for backend services) for environments you trust.
  </Step>
</Steps>

Unlinking the repository stops new code-backed resolutions until you link again. Historical PRs are unchanged.

***

## What happens when an incident fires

<Steps>
  <Step title="Incident opens">
    An error spike or exception creates an incident on the linked site or service.
  </Step>

  <Step title="Pull workspace">
    From the resolution workspace, pull the mapped branch. Browse the tree and open the frame that matches the stack.
  </Step>

  <Step title="Root cause">
    Liter reasons over the real source — not a summary — and writes the cause and recommended next steps.
  </Step>

  <Step title="Open a PR">
    After verify, Tracelit opens a pull request on a fresh branch with the diff, root-cause summary, and a link back to the incident.
  </Step>
</Steps>

<Note>
  Tracelit never pushes directly to your default branch. Every fix lands on a separate branch and goes through your normal PR process.
</Note>

***

## Permissions

The GitHub App needs enough access to:

* Read repository contents (for workspace pull and analysis)
* Create branches and pull requests (for autonomous resolution)
* Receive webhook events so PR merge/close updates the incident and resolution job

You control which repositories the App can access during install (and later in GitHub → **Settings → Applications**).

***

## Webhooks

Tracelit listens to GitHub events on linked repositories:

| GitHub event                        | Tracelit action                                           |
| ----------------------------------- | --------------------------------------------------------- |
| PR merged                           | Incident marked resolved; resolution job closed as merged |
| PR closed (without merge)           | Resolution job marked dismissed                           |
| Review submitted                    | Confidence and review status updated on the job           |
| New commit pushed to the fix branch | Re-evaluates auto-merge eligibility                       |

***

## Auto-merge (optional)

Configure per service whether Tracelit may merge high-confidence PRs after CI passes. Branch protection and required checks are always respected.

See [GitHub PR](/features/github-pr) for auto-merge settings and confidence thresholds.

***

## Related

| Topic                              | Guide                                  |
| ---------------------------------- | -------------------------------------- |
| Repository & environment utilities | [Utilities](/agentic/utilities)        |
| Agentic resolution loop            | [Resolutions](/agentic/resolutions)    |
| PR product details                 | [GitHub PR](/features/github-pr)       |
| All code hubs                      | [Integrations](/integrations/overview) |
