CLIPlatform

git

Connect a GitHub repository for push-to-deploy.

Use git commands to manage the GitHub repository connection. Connecting enables the OIDC credential exchange for GitHub Actions deploys and the branch lifecycle automation. See GitHub integration and Deploy on push.

Usage

npx prisma git connect

Run it from a linked project directory, or name the project with --project <id-or-name>. Without a URL, it connects the repository of the directory's origin remote.

If the Prisma GitHub App does not cover the repository yet, the command opens the browser to install it or give it access to the repository, and waits until that is done. That step needs an interactive terminal: in CI, without a terminal, or with --no-interactive, it fails with CLI.INTERACTION_REQUIRED and prints the install URL. When the app already covers the repository, the command needs no terminal and runs in scripts.

Connecting from the CLI does not add a deploy workflow to the repository. Add it yourself, or connect through the Console, which opens a pull request with the workflow.

Commands

CommandDescription
git connect [git-url]Connect the linked project to a GitHub repository. Starts the GitHub App install flow if needed
git disconnectStop the credential exchange and branch automation. Keeps the project and existing branches

Both commands take --project <id-or-name> to name a project other than the one this directory is linked to.