Git on Clever Cloud

Clever Cloud uses Git-based deployments. This guide explains how to deploy with Git and handle common scenarios.

Git-based deployments

Clever Cloud deploys your application when you push to the Clever Git remote.

Configure the Git remote

git remote add clever <your-git-deployment-url>

Find the deployment URL in the Console → your application → Information. See Troubleshooting for additional examples.

Push branches

# If your local branch is main
git push clever main:master

# If your local branch is master
git push clever master

The Clever remote expects the branch named master. Map your local branch accordingly.

Shallow clone vs full clone

By default, deployments perform a full clone. To speed up deployments, set CC_GIT_FULL_CLONE=false to use a shallow clone (--depth 1). See the Environment variable reference.

Monorepos (subdirectory deploy)

If your application lives in a subdirectory, set APP_FOLDER to that path (relative to the repository root). See the Environment variable reference.

Deploy private Git submodules

If your application uses private Git submodules, avoid storing credentials in .gitmodules. Use SSH URLs and provide an SSH key at deploy time.

  1. Use an SSH URL for each submodule
# Add a new submodule (example)
git submodule add git@github.com:org/repo.git path/to/subdir
  1. Provide an SSH key for the build
  • Set the CC_SSH_PRIVATE_KEY environment variable with a private key that has read access to your submodule(s).
  • Optionally set CC_SSH_PRIVATE_KEY_FILE to control the filename used on the instance.
  • The key is installed into ~/.ssh before the build so Git operations (including submodules) can authenticate.
  • Alternatively, commit clevercloud/ssh.json to reference a private key file in your repo (see the linked documentation for the expected format).
ℹ️
Provide a key without pass phrase. Submodules are initialized during deployment unless you disable them with CC_DISABLE_GIT_SUBMODULES.

Learn more: Private SSH key configuration · Environment variable reference

Last updated on

Did this documentation help you ?