Support Portal

Submit a ticket My Tickets
Welcome
Login

Connecting a Git Repository to a Strapi CLI Project

Note: The Strapi Cloud CLI is recommended for testing purposes only. For production environments, deploying your project from a Git repository (GitHub or Gitlab) is the preferred approach.


The Strapi Cloud CLI is an excellent tool for quickly launching and testing a project on Strapi Cloud without needing a Git repository. While this is ideal for initial experimentation and understanding how Strapi Cloud works, it is not suitable for long-term use. For production-grade projects, connecting your project to a Git repository ensures robust source control and collaboration.


Deploying from a Git repository offers several advantages:

  • Proper source control for managing project changes.
  • The ability to add collaborators to your repository.
  • Automated deployments triggered by commits to a selected branch.


If you've already created a project using the CLI, follow the steps below to connect it to a Git repository.


How to Connect Your Project to a Git Repository

Important: Changing the owner of a project after it is created is not possible at this time.


Steps:

  1. Push the Code to a Git Repository 
    First, upload your project code to a GitHub or Gitlab repository.
  2. Access the Strapi Cloud Dashboard
    The project owner must log in to the Strapi Cloud Dashboard and navigate to the specific project.
  3. Open Project Settings
    - In the dashboard, go to the Settings section.
    - Under the General category, locate the Connected git repository section.
  4. Connect the Repository
    - Click on Connect a repository.
    - Select the Git provider (e.g., GitHub or Gitlab) where your code is hosted.
    - Authenticate with the chosen Git provider if prompted.
  5. Select Repository and Branch
    - Choose the repository and the branch you want Strapi Cloud to use.
    - Specify additional options, such as the subdirectory where the project code resides, if applicable.


Once the repository is connected, Strapi Cloud will consider it the project’s "source of truth." Deployments will occur automatically whenever a commit is made to the configured branch, such as via pull requests.

K
Kellen is the author of this solution article.

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.