> For the complete documentation index, see [llms.txt](https://docs.hostinger.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hostinger.com/websites/git.md).

# Git

Deploy your site from a Git repository. Push to the connected branch and Hostinger pulls the latest files into your chosen directory — no manual uploads, no SSH.

> **Note:** This is the generic Git feature for any website: static HTML, PHP apps, WordPress custom code — anything that runs what's in the repo as-is. For Node.js apps that need to run a build step (install deps, run `npm run build`, start the server), use the Node.js-specific [GitHub](/node.js/github.md) integration instead.

## What it does

* Pulls files from your repo into a target directory on your site
* Replaces existing files in that directory on each deploy
* Does **not** run a build step — the files committed to the repo are the files served

## Two ways to connect

|             | GitHub auto-deployments                 | SSH-based deployment (legacy)                                |
| ----------- | --------------------------------------- | ------------------------------------------------------------ |
| Providers   | GitHub                                  | Any Git host (GitHub, GitLab, Bitbucket, …)                  |
| Auth        | Hostinger GitHub App                    | Deploy SSH key                                               |
| Auto-deploy | On by default (webhook managed for you) | Manual webhook setup                                         |
| Where       | **Advanced** → **Git**                  | **Advanced** → **Git** (shown if you have an SSH key set up) |

New connections should use GitHub auto-deployments. The SSH flow remains available for non-GitHub hosts and existing setups.

## GitHub auto-deployments

### Connect a repository

1. Open your website dashboard in hPanel and go to **Advanced** → **Git**.
2. Click **Connect with GitHub** — a popup installs the Hostinger GitHub App on your account. Choose which repositories to grant access to.
3. Pick the repository to import. Use **Refresh repositories** or check your GitHub access settings if one is missing.
4. Configure the deployment:

   | Setting              | Description                                                                                           |
   | -------------------- | ----------------------------------------------------------------------------------------------------- |
   | **Branch**           | The branch that triggers deployments                                                                  |
   | **Deploy directory** | Root (`public_html`) by default, or click **Change** to deploy to a subfolder like `public_html/blog` |
5. Click **Deploy** for the initial deployment. Progress and logs stream live.

### Automatic deployments

Once connected, every push to the selected branch deploys automatically:

1. You push to the connected branch.
2. GitHub notifies Hostinger via webhook.
3. Hostinger pulls the latest code.
4. Files are replaced in the deploy directory.

No build step runs — what's in the repo is what gets served. The website dashboard shows an **Auto-deployment** chip while the connection is healthy.

### Manual deployment

Click **Redeploy** on the Git page's **Overview** tab to pull the latest code on demand. History lists it as a "Manual deployment" (no commit attached).

### Deployment history

The **Deployments** tab lists recent deployments — branch, commit, time, and status (**Deploying / Completed / Build failed**), with the live one labeled **Current**. Click a row for the full deployment log. Logs from recent deployments are retained; older ones are pruned.

### Connection status and disconnecting

The Overview tab shows the same connection states as the Node.js integration — connected, not connected, different GitHub account, or repository access missing — with a one-click fix for each. From the menu you can:

* **Disconnect from repository** — stops deployments for this site only; your GitHub account stays connected.
* **Disconnect GitHub** — removes the installation; deployments stop for **all** sites connected to that account. Already-deployed files stay in place.

## SSH-based deployment (legacy)

Works with any Git host. Shown on the **Git** page for accounts that have a deploy SSH key.

1. **Private repos:** click **Generate SSH Key**, copy it, and add it as a deploy key on your Git host (GitHub, GitLab, Bitbucket, etc.).
2. **Add the repository:** enter the repository URL (`https://...git` for public, `git@...:...git` for private), the branch, and the target directory. Leave the directory blank to deploy to `public_html` — the target directory must be empty for the first deployment.
3. **Deploy:** use the repository's actions menu — **Deploy** pulls the latest code; **View latest build output** shows the last deployment log.
4. **Auto deployment:** the **Auto Deployment** action shows a **webhook URL**. Add it as a push webhook in your Git host's repository settings, and every push triggers a deploy.

To remove a repository, use **Delete** in its actions menu.

## Branch strategy

* Deploy `main` for simple, always-live workflows.
* Use a dedicated `production` branch to batch changes and control what ships.
* For preview workflows, deploy a testing branch to a separate site on a free subdomain before merging to the live branch.

## Troubleshooting

**Deployments not triggering on push** GitHub auto-deployments: confirm you're pushing to the connected branch and the connection status is healthy (no account mismatch or missing repository access). SSH-based: verify the webhook URL is configured on your Git host.

**Files not updating after deployment** Review the deployment log for errors. If caching is enabled, [clear the cache](/websites/cache.md) to force fresh content.

**GitHub lost access** The Git page shows **Repository access missing** — click **Manage access** to restore the Hostinger app's repository access in GitHub, or reconnect from hPanel if the installation was removed.

**SSH deployment fails on first pull** The install directory must contain no files or folders. Clear it (or pick an empty subdirectory) and deploy again.

**My project needs a build step** This feature serves files as-is. For Node.js apps that need `npm install` and a build, see [GitHub](/node.js/github.md) under Node.js.

***

*Last updated: July 22, 2026*
