Skip to main content

Git

Nhost allows you to automatically deploy your Nhost project when you do changes to your Git repository.

Supported Git Providers

  • GitHub

Support GitLab, BitBucket, and other Git providers are on our roadmap.

Deployment

The following things are deployed:

  • Database migrations
  • Hasura metadata
  • Serverless Functions
  • Email Templates
caution

Settings in nhost/config.yaml are not deployed. That means you need to manually sync settings between local and remote environments between the CLI and Nhost Cloud.

Using GitHub

  1. From your Nhost project, click Connect to Github.

Connect to GitHub

  1. Install the Nhost project on your Github account.

Install the Nhost GitHub App

  1. Connect your Github repository.

Select reopsitoru

Deployment Branch

Nhost only deploys changes from the Deployment Branch. By default, your deployment branch matches the default branch (usually main).

You can change the Deployment Branch on the Git page in the Settings section.

It's possible to have multiple Nhost projects connected to the same Git repository and use different Deployment Branches (e.g., main and staging). Learn more about multiple environments.

Base Directory

If your Nhost project is not located at the root of your Git repository, which is typically the case when using a monorepo, it's possible to set a custom Base Directory. The Base Directory is where the nhost/ directory is located. In other words, the Base Directory is the parent directory of the nhost/ directory.

You can change the Base Directory on the Git page in the Settings section.