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

# Git

> Built-in Gitea server — browse repositories, manage webhooks, trigger deployments, and view full deployment logs.

<Info>
  **Path:** Git (`/git`) — Admin only

  AreaWP includes a built-in Gitea Git server. Install it once on your server, then manage repositories, webhooks, and deployments from the panel.
</Info>

## Installation

If Gitea is not installed, the page shows an empty state with resource requirements. Click **Install** to open the setup modal:

* Set the Gitea admin username and password
* AreaWP installs and configures Gitea as a system service

**Header actions after install:** Open Gitea (external link), Start, Stop.

***

## Status Cards

Once installed, four cards show the current state:

| Card              | Shows                          |
| ----------------- | ------------------------------ |
| **Server Status** | Running / stopped with version |
| **URL Path**      | HTTP access URL                |
| **SSH Port**      | Git-over-SSH port              |
| **Version**       | Installed Gitea version        |

***

## Tabs

### Overview

Server info panel with HTTP and SSH access URLs (with copy buttons) and quick-action shortcuts.

### Repositories

Two modes:

**Repository List** — all repositories with owner, name, forks, stars, and description.

**Repository Detail** (click any repo) — full file browser:

* Folder and file navigation with sizes
* **Commits** tab — commit log with author, date, and message
* **Branches** tab — all branches with switch button

### Access

HTTP and SSH access configuration for this Gitea instance, with copy buttons for each URL format.

### Webhooks

All configured deployment webhooks:

| Column        | Description                 |
| ------------- | --------------------------- |
| **Name**      | Webhook display name        |
| **Source**    | Repository URL and branch   |
| **URL**       | Deployment target URL       |
| **Last Sync** | Most recent webhook trigger |

**Add Webhook** button opens a full configuration modal:

* Name, source repo URL, branch to watch
* Deployment settings (target server, path)
* Pre-deploy and post-deploy shell scripts
* Secret token for webhook verification

**Actions per webhook:** Test, Toggle (enable/disable), Delete.

### Deployments

Full deployment history across all webhooks:

| Column        | Description                          |
| ------------- | ------------------------------------ |
| **Status**    | Success / Failed / In Progress badge |
| **Commit**    | Short hash and message               |
| **Branch**    | Source branch                        |
| **Duration**  | How long the deployment took         |
| **Triggered** | Timestamp                            |

Click **View Logs** to open the deployment log modal showing pre-deploy, deploy, and post-deploy output separately. Click **Rollback** to redeploy a previous successful run.

### Settings

Start, stop, and uninstall Gitea from the panel. Uninstalling removes the service but preserves repository data.

***

## Webhook Configuration

A webhook fires on every push to the configured branch. The deployment process:

1. **Pre-deploy script** — runs before files are updated (e.g. put site in maintenance mode)
2. **Deploy** — pulls the latest commit to the target path
3. **Post-deploy script** — runs after update (e.g. `php artisan migrate`, `wp cache flush`)

If any step fails, the deployment is marked as Failed and subsequent steps are skipped.
