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

# Source integrations

> See how to maintain your code in a third-party repository that's linked to your Upsun project.

A source integration links your Upsun project to a third-party Git repository (GitHub, GitLab, or Bitbucket),
making that repository the source of truth. Upsun mirrors the repository and manages environments
based on your repository's branch and pull request activity. For example:

* When you open a pull request, Upsun spins up an identical preview environment that reflects the contents of the pull request.
* After you push code to your external repository, Upsun mirrors the updated code and redeploys the affected environments.

This integration enables you to keep your code and CI/CD workflows on your Git provider of choice and use Upsun for deployment.

<Warning>
  If you connect an external repo to Upsun, do not push code directly to Upsun: push to your external repository.

  Upsun overwrites any changes pushed to it directly in order to mirror the external repository.
</Warning>

<CardGroup cols={2}>
  <Card title="Bitbucket" icon="git-branch" href="/docs/integrations/source/bitbucket">
    Manage your Upsun environments directly from your Bitbucket repository.
  </Card>

  <Card title="GitHub" icon="github" href="/docs/integrations/source/github">
    Manage your Upsun environments directly from your GitHub repository.
  </Card>

  <Card title="GitLab" icon="gitlab" href="/docs/integrations/source/gitlab">
    Manage your Upsun environments directly from your GitLab repository.
  </Card>

  <Card title="Troubleshoot" icon="wrench" href="/docs/integrations/source/troubleshoot">
    Resolve access rights issues with integrated repositories.
  </Card>
</CardGroup>
