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

# GitHub Integration

> Install the Capy GitHub App to connect repositories, manage branches automatically, and create pull requests from AI-generated code changes.

## Connecting GitHub

Install the Capy GitHub App from the dashboard by clicking **Connect GitHub**, then choose which repositories to grant access to. You can update repo access anytime in your GitHub settings.

## Working with repos

Repositories are cloned automatically when a task starts. Capy creates a branch (`capy/<task-slug>-<id>`) for each task - your main branch stays clean. When you're happy with the changes, click **Create PR** in the diff view and merge on GitHub.

You can set the default branch for each repo (e.g., `main`, `develop`) from the dashboard.

## Permissions

| Permission    | Purpose          |
| ------------- | ---------------- |
| Contents      | Read/write code  |
| Pull requests | Create PRs       |
| Issues        | Read for context |
| Metadata      | Repo info        |

## Troubleshooting

<AccordionGroup>
  <Accordion title="Repo not appearing">
    Check that the GitHub App is installed and you've selected the repo in your
    GitHub settings. You may need to re-authorize if you recently changed org
    permissions.
  </Accordion>

  <Accordion title="Push failed">
    Make sure you're on a working branch (`capy/*`). Capy never pushes directly
    to your default branch.
  </Accordion>
</AccordionGroup>
