Skip to main content

Changing Git Repository

You can change the Git repository or branch associated with an existing application without recreating it. This is useful when you move your code to a new repository, fork a project, or want to deploy a different branch.

Changing the Repository or Branch

  1. Go to your application in the dashboard
  2. Open Application Settings > Build Settings tab
  3. Update the repository URL or select a different branch
  4. Save the changes

The next deployment will pull code from the new repository or branch.

When to Use This

  • Repository migration -- you moved your code from one Git host to another (e.g., from Bitbucket to GitHub)
  • Fork deployment -- you want to deploy a fork instead of the original repository
  • Branch switching -- you want to deploy from a different branch (e.g., switching from develop to main for production)
  • Monorepo changes -- your repository structure changed and you need to point to a new path

Notes

  • Changing the repository does not trigger an automatic deployment. You need to manually deploy or push to the new branch to start a build.
  • If you switch to a repository with a different structure, make sure your build settings, processes, and environment variables are still valid for the new codebase.
  • For GitHub and GitLab repositories, the push-to-deploy webhook is updated to point to the new repository. For custom Git repositories, you need to configure the webhook in the new repository manually.
  • Your deployment history is preserved. Previous deployments still reference the old repository and commits.