# GitHub (/docs/compute/github) > For the complete Prisma documentation index, see [llms.txt](https://www.prisma.io/docs/llms.txt). A markdown version of any docs page is available by appending `.md` to its URL. Connect a GitHub repository to a project to authenticate your Actions deploys and keep platform branches in sync with your Git branches. Location: Compute > GitHub Connecting a GitHub repository wires a project to your repo. Deploys run in your own GitHub Actions, through [prisma/cloud-deploy-action](https://github.com/prisma/cloud-deploy-action); the connection provides two things around them: - **Credentials.** Workflow runs in the connected repository exchange their GitHub OIDC token for a short-lived Prisma workspace token, so the deploy workflow needs no secrets. - **Branch lifecycle.** Branch events keep the matching platform branches in sync, including tearing a preview down when its Git branch is deleted. For the full setup, from connection to a live preview for every pushed branch other than the default one, follow [Deploy on push](https://www.prisma.io/docs/compute/deploy-on-push). ## How it works [#how-it-works] The connection has two levels: The workspace owns the GitHub App installation; each project points at a single repository. Once connected, Prisma verifies the repository identity behind each credential exchange and listens for the repo's branch events. ## Connect a repo [#connect-a-repo] You can connect through the [Console](https://pris.ly/pdp) or from the CLI. The Console also opens a pull request that adds the deploy workflow to the repository. The CLI sets up the connection only, and you [add the workflow yourself](https://www.prisma.io/docs/compute/deploy-on-push#4-add-the-deploy-workflow). From a linked project directory, connect your Git origin: #### npm ```bash npx prisma git connect ``` #### pnpm ```bash pnpm prisma git connect ``` #### yarn ```bash yarn prisma git connect ``` #### bun ```bash bunx prisma git connect ``` To name the repository explicitly: #### npm ```bash npx prisma git connect https://github.com/acme/shop ``` #### pnpm ```bash pnpm prisma git connect https://github.com/acme/shop ``` #### yarn ```bash yarn prisma git connect https://github.com/acme/shop ``` #### bun ```bash bunx prisma git connect https://github.com/acme/shop ``` If the GitHub App doesn't cover the repository yet, the CLI opens the browser to install it or give it access. That step needs an interactive terminal: it waits for the install to complete, and without a terminal, or with `--no-interactive`, it fails with `CLI.INTERACTION_REQUIRED` and prints the install URL. Open that URL, give the app access to the repository, and run the command again: once the app covers the repository, the command runs in scripts. You can also connect through the Console instead. Disconnect when you're done: #### npm ```bash npx prisma git disconnect ``` #### pnpm ```bash pnpm prisma git disconnect ``` #### yarn ```bash yarn prisma git disconnect ``` #### bun ```bash bunx prisma git disconnect ``` Disconnecting stops the credential exchange and the branch automation. It doesn't delete the project or tear down existing branches. ## What the connection does [#what-the-connection-does] Once a project is connected: - **Actions runs can authenticate.** A workflow job with `id-token: write` gets a workspace token through the OIDC exchange. The token is valid for 30 minutes and is only issued for the connected repository; unconnected repositories and forks are refused, and the deploy action then skips with a green run. - **Branch created** → creates the matching platform branch. - **Branch deleted** → tears down the matching platform branch and its resources. Your production and default branches are exempt from this cleanup. Pushes are not handled by the platform. Your repository's own workflow deploys them, so a connected repo without a deploy workflow deploys nothing. Connecting also doesn't create branches retroactively: it aligns your default branch with the repo's default branch and wires up automation for future events. ## What's not supported [#whats-not-supported] GitHub is the only supported provider; others return `REPO_PROVIDER_UNSUPPORTED`. Pull-request comments and preview comments aren't currently supported. ## Troubleshooting [#troubleshooting] ### "This repository is already linked to a project" [#this-repository-is-already-linked-to-a-project] A GitHub repository can be connected to only one Prisma project at a time, even across different workspaces. If another project is already connected to the repository, connecting it to a second project fails with "This repository is already linked to a project". To move the repository to the new project, disconnect it from the other project first by running `npx prisma git disconnect` in a directory linked to that project. Run `npx prisma project show` to see which project your current directory is linked to. If it's linked to the new project, switch it to the other project with [`npx prisma project link`](https://www.prisma.io/docs/cli/project), disconnect, and then switch it back. Pass each project's name or id in place of `` and ``: #### npm ```bash title="Terminal" npx prisma project link npx prisma git disconnect npx prisma project link ``` #### pnpm ```bash title="Terminal" pnpm prisma project link pnpm prisma git disconnect pnpm prisma project link ``` #### yarn ```bash title="Terminal" yarn prisma project link yarn prisma git disconnect yarn prisma project link ``` #### bun ```bash title="Terminal" bunx prisma project link bunx prisma git disconnect bunx prisma project link ``` Then connect the new project with `npx prisma git connect`, as described in [Connect a repo](#connect-a-repo). If you don't have access to the other project, uninstall the Prisma GitHub App from the GitHub account that owns the repository instead: - For a repository on your personal account, go to **Settings** > **Applications** > **Installed GitHub Apps** in GitHub. - For a repository owned by an organization, go to the organization's **Settings** > **GitHub Apps**. Only an organization owner can uninstall an app there. Then run `npx prisma git connect` from the new project's directory. It opens the browser so you can install the app and connect the repository. Uninstalling the app disconnects every repository that was connected through it, not only this one. Until you run `npx prisma git connect` again for each of those projects, their deploy workflow runs pass without deploying anything, as described in [What the connection does](#what-the-connection-does). ## Next steps [#next-steps] - [Deploy on push](https://www.prisma.io/docs/compute/deploy-on-push): the full walkthrough, from connection to a preview for every pushed branch other than the default one. - [Environments](https://www.prisma.io/docs/compute/branching): how platform branches map to Git. - [Environment variables](https://www.prisma.io/docs/compute/environment-variables): per-branch config for previews. - [Deploy an existing app](https://www.prisma.io/docs/guides/compute/deploy-existing-app): move a Node.js server already on Prisma 8 onto Compute. ## Related pages - [Alchemy](https://www.prisma.io/docs/compute/alchemy): Provision Prisma Postgres and deploy applications to Prisma Compute in one TypeScript stack. - [Deploy Button](https://www.prisma.io/docs/compute/deploy-button): Add a Deploy with Prisma button that copies a public Composer repository and starts a Composer-managed deployment. - [Deployments](https://www.prisma.io/docs/compute/deployments): How deploys create service versions on Prisma Compute, and how to inspect, promote, roll back, start, and stop them. - [Domains](https://www.prisma.io/docs/compute/domains): Add a custom domain to an app on any branch, publish the two DNS records it asks for, and the platform issues the TLS certificate. - [Environment variables](https://www.prisma.io/docs/compute/environment-variables): Project configuration that gets injected into your deployments, scoped to production, preview, or a single branch.