Product Guide
Git Connections
Overview

Git Connections

Git Connections link your GitHub, GitLab, or Bitbucket accounts to OEC.sh. Once connected, you can deploy Odoo projects from your private repositories, access custom addon repos, pull updates when syncing environments, and use multiple Git providers at the same time.

Connecting with OAuth (Recommended)

OAuth uses your existing Git account login and automatically refreshes access.

  1. Go to Settings in the sidebar
  2. Click Git Connections
  3. Click Add Git Connection
  4. Select your provider (GitHub, GitLab, or Bitbucket)
  5. Click Connect with GitHub, Connect with GitLab, or Connect with Bitbucket
  6. Authorize OEC.sh in the popup window
  7. Your connection appears in the list

For GitLab self-hosted instances, enter your GitLab URL before clicking Connect.

Connecting with Personal Access Token

Personal Access Tokens give you finer control over permissions and work well for automation or CI pipelines.

To create a GitHub token:

  1. Go to GitHub Settings > Developer settings > Personal access tokens
  2. Click Generate new token (classic)
  3. Set an expiration date (90 days recommended) and select the repo and read:org scopes
  4. Copy the token (starts with ghp_)

To create a GitLab token:

  1. Go to GitLab Preferences > Access Tokens
  2. Set an expiration date and select api and read_repository scopes
  3. Copy the token (starts with glpat-)

To create a Bitbucket token:

  1. Go to Bitbucket Personal Settings > App passwords
  2. Click Create app password
  3. Give it a label and select Repositories: Read and Repositories: Write permissions
  4. Copy the generated password

To add your token to OEC.sh:

  1. Go to Settings > Git Connections
  2. Click Add Git Connection
  3. Select your provider (GitHub, GitLab, or Bitbucket)
  4. Choose Personal Access Token (or GitLab Token for GitLab, or App Password for Bitbucket)
  5. Enter a name and paste your token
  6. Click Create Connection

Connecting with GitHub App

GitHub Apps provide repository-level permissions and are a good fit for organizations that want tighter access control.

  1. Go to Settings > Git Connections
  2. Click Add Git Connection
  3. Select GitHub as the provider
  4. Choose GitHub App as the authentication method
  5. Enter:
    • App ID: Found in your GitHub App settings
    • Installation ID: Found in the URL when viewing your app installation
    • Private Key: Generate and download from your GitHub App settings
  6. Click Create Connection

GitHub Apps allow repository-level access control and don't expire like tokens.

Selecting Repositories

After connecting, you can browse your repositories when creating or editing projects.

  1. Create a new project or edit an existing one
  2. Click the repository dropdown and choose your Git connection
  3. Search or scroll to find your repository
  4. Select the repository and choose a branch

Repositories are sorted by recent activity, so your most-used projects appear first.

Webhook Setup for Auto-Deploy

Webhooks trigger automatic deployments when you push code. There are three ways to set them up:

Automatic Setup (OAuth Connections)

When you create a project using an OAuth-connected Git account, the webhook is automatically configured:

  1. Create a new project and select your repository
  2. Choose a branch to track
  3. The webhook is created automatically on your repository
  4. Pushes to the tracked branch trigger deployments

Automatic webhook setup requires an OAuth connection. Token-based connections require manual webhook configuration.

Setup Webhook Button (Existing Projects)

If your project was created without a webhook, you can add one from project settings:

  1. Go to your Project > Settings tab
  2. Find the Repository section
  3. Click the Setup Webhook button
  4. Select a Git connection with OAuth permissions
  5. The webhook is created on your repository
⚠️

The Setup Webhook button only appears if your project doesn't have a webhook configured. You need a Git connection with OAuth permissions for this to work.

Manual Webhook Configuration

For token-based connections or advanced setups, configure the webhook manually:

  1. Go to your Project > Settings tab
  2. Find the Webhook section
  3. Copy the Webhook URL
  4. Copy the Webhook Secret
  5. Add the webhook in your Git provider:

For GitHub:

  1. Go to your repository > Settings > Webhooks
  2. Click Add webhook
  3. Paste the Webhook URL
  4. Set Content type to application/json
  5. Paste the Webhook Secret
  6. Select Just the push event
  7. Click Add webhook

For GitLab:

  1. Go to your repository > Settings > Webhooks
  2. Paste the Webhook URL
  3. Paste the Webhook Secret in the Secret token field
  4. Check Push events
  5. Click Add webhook

Auto-Deploy Configuration

Once a webhook is configured, enable auto-deploy for each environment:

  1. Go to your Environment > Settings
  2. Find the Auto-Deploy toggle
  3. Enable auto-deploy
  4. Optionally configure branch filtering

When enabled, pushing to the tracked branch automatically triggers a deployment for that environment.

Auto-deploy respects branch settings. If your environment tracks the main branch, pushes to develop won't trigger deployments.


Automatic Deployments

When you deploy an environment, OEC.sh clones your repository, pulls the latest code from your selected branch, and installs your Odoo modules.

For OAuth connections, tokens refresh automatically. For Personal Access Tokens, update them before they expire.

Managing Connections

Validating a Connection

  1. Go to Settings > Git Connections
  2. Find your connection in the list
  3. Click the Validate button (checkmark icon)
  4. Check the result message

Refreshing OAuth Token

For OAuth connections that need refreshing:

  1. Go to Settings > Git Connections
  2. Click the Refresh Token button on the connection
  3. The token is automatically refreshed

Enabling/Disabling a Connection

You can temporarily disable a connection without deleting it:

  1. Go to Settings > Git Connections
  2. Click the toggle button on the connection
  3. Disabled connections show an X icon instead of a checkmark

Updating a Token

  1. Create a new token in GitHub or GitLab
  2. Go to Settings > Git Connections
  3. Click Edit on the connection
  4. Paste your new token and click Save

Deleting a Connection

  1. Go to Settings > Git Connections
  2. Click the Delete button (trash icon) on the connection
  3. Confirm deletion
⚠️

Before deleting a connection, make sure no active environments depend on it.

Connection Status

Each connection shows one of these statuses:

StatusMeaning
ActiveWorking normally
ExpiredToken needs refresh or renewal
RevokedToken was revoked on the provider side
ErrorSomething went wrong, check your credentials
InvalidCredentials are invalid or malformed
PendingConnection is being validated

If a connection shows Expired or Error, try validating it first. For OAuth, you can refresh the token or reconnect. For Personal Access Tokens, create a new one and update the connection.

Shared Connections

Git connections are shared with everyone in your organization. When you create a connection, all team members can use it for deployments.

The connection card shows who created each connection for audit purposes.

OAuth connections use the permissions of the person who created them. If that person loses access to a repository, the connection stops working for that repository.