Skip to content

Git integration

You can connect each Cloudflare Pages project to a GitHub or GitLab repository, and Cloudflare will automatically deploy your code every time you push a change to a branch.

When you connect a git repository to your Cloudflare Pages project, Cloudflare will also:

  • Preview deployments for custom branches, generating preview URLs for a commit to any branch in the repository without affecting your production deployment.
  • Preview URLs in pull requests (PRs) to the repository.
  • Build and deployment status checks within the Git repository.
  • Skipping builds using a commit message.

These features allow you to manage your deployments directly within GitHub or GitLab without leaving your team's regular development workflow.

Supported Git providers

Cloudflare supports connecting Cloudflare Pages to your GitHub and GitLab repositories. Pages does not currently support connecting self-hosted instances of GitHub or GitLab.

If you using a different Git provider (e.g. Bitbucket) or a self-hosted instance, you can start with a Direct Upload project and deploy using a CI/CD provider (e.g. GitHub Actions) with Wrangler CLI.

Add a Git integration

If you do not have a Git account linked to your Cloudflare account, you will be prompted to set up an installation to GitHub or GitLab when connecting to Git for the first time, or when adding a new Git account. Follow the prompts and authorize the Cloudflare Git integration.

You can check the following pages to see if your Git integration has been installed:

For details on providing access to organization accounts, see the GitHub and GitLab guides.

Manage a Git integration

You can manage the Git installation associated with your repository connection by navigating to the Pages project, then going to Settings > Builds and selecting Manage under Git Repository.

This can be useful for managing repository access or troubleshooting installation issues by reinstalling. For more details, see the GitHub and GitLab guides.

Disable automatic deployments

If you are using a Git-integrated project and do not want to trigger deployments every time you push a commit, you can use branch control to disable/pause builds:

  1. Go to the Settings of your Pages project in the Cloudflare dashboard.
  2. Navigate to Build > edit Branch control > turn off Enable automatic production branch deployments.
  3. You can also change your Preview branch to None (Disable automatic branch deployments) to pause automatic preview deployments.

Then, you can use Wrangler to deploy directly to your Pages project and make changes to your Git repository without automatically triggering a build.