> ## Documentation Index
> Fetch the complete documentation index at: https://docs.loupp.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Source Control

> Connect and manage your source control providers in Loupp

## Overview

Source control integration allows you to connect your GitHub, GitLab, and Bitbucket accounts to Loupp for seamless deployment and repository management. Link multiple providers to access repositories across different platforms.

> [card] [Related Documentation](https://docs.loupp.dev/sites/create)
>
> Learn how to create sites using connected source control providers.

## Supported Providers

### Available Platforms

> [card] GitHub
>
> Connect your GitHub repositories for deployment

> [card] GitLab
>
> Link GitLab projects and repositories

> [card] Bitbucket
>
> Only available for authenciation

## Connecting Providers

### Authentication Process

**1. Select provider**

Click on the provider card you want to connect

**2. OAuth authentication**

Redirect to provider's OAuth authorization page

**3. Grant permissions**

Authorize Loupp to access your repositories

**4. Return to dashboard**

Automatically redirected back to source control settings

### Provider Information

> [accordion] User Details
>
> **Username**: Displayed username from the connected account
>
> **Installation Count**: Number of sites using this provider

> [accordion] Connection Status
>
> **Active**: Green indicator for connected providers
>
> **Inactive**: Red indicator for unconnected providers

## Managing Connections

### Provider Actions

> [accordion] Link Provider
>
> **Action**: Click arrow icon on inactive provider
>
> **Result**: Redirects to OAuth authentication flow

> [accordion] Refresh Connection
>
> **Action**: Click refresh icon on active provider
>
> **Result**: Re-authenticates and updates connection

> [accordion] Unlink Provider
>
> **Action**: Click unlink icon on active provider
>
> **Restriction**: Cannot unlink if provider has active sites
>
> **Result**: Removes provider connection

### Connection Requirements

> [!WARNING]
>
> You must have at least one source control provider connected to deploy sites. You cannot unlink a provider that has active sites deployed.

## Repository Access

### Branch Management

> [accordion] Branch Retrieval
>
> **GitHub**: Fetches branches via GitHub API
>
> **GitLab**: Retrieves branches with automatic token refresh

> [accordion] API Integration
>
> * Automatic branch listing for deployment
> * Repository access for site creation
> * Webhook support for automatic deployments

### Provider-Specific Features

> [accordion] GitHub Features
>
> * Repository branch access
> * OAuth token management
> * Webhook integration

> [accordion] GitLab Features
>
> * Automatic token refresh
> * Project-based repository access
> * Enhanced error handling

## Security and Permissions

### OAuth Scopes

> [card] Repository Access
>
> Read access to repositories and branches

> [card] Webhook Management
>
> Create and manage deployment webhooks

### Token Management

> [accordion] Access Tokens
>
> * OAuth tokens stored securely
> * Automatic token refresh for GitLab
> * Token validation and error handling

> [accordion] Security Features
>
> * Encrypted token storage
> * Automatic token expiration handling
> * Secure API communication

## Integration with Deployment

### Site Creation

**1. Select provider**

Choose connected source control provider during site creation

**2. Repository selection**

Browse and select repositories from connected providers

**3. Branch configuration**

Select deployment branch and configure webhooks

> [card] [Site Creation Guide](https://docs.loupp.dev/sites/create)
>
> Learn how to create sites using your connected source control providers.

### Deployment Workflow

> [accordion] Automatic Deployments
>
> * Webhook-triggered deployments on code pushes
> * Branch-specific deployment configurations
> * Real-time deployment status updates

> [accordion] Manual Deployments
>
> * Manual deployment triggers
> * Branch switching capabilities
> * Deployment history tracking

> [card] [Deployment Management](https://docs.loupp.dev/sites/deployments.md)
>
> Learn how to manage deployments and view deployment history.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.