Skip to main content
All CollectionshPanelAdvanced
How to Deploy a Git Repository
How to Deploy a Git Repository

Deploying and managing git repositories using Hostinger’s hPanel

Updated over 3 months ago

Git is a Version Control System that can be used to track changes in any file and is commonly used to develop software. While it is mainly designed to coordinate work among programmers, it can also be used to track changes in any set of files.

Deployment

If you wish to deploy a Git repository, find your target site in the Websites section and click on Manage next to it.

Then, search for Git on the left sidebar and click on the result:

The Git section in hPanel at Hostinger

In the Create a New Repository field, you can set up your deployment settings:

  • Make sure you select the correct Repository Address and Branch, or the deployment will fail

  • Leave the Install Path empty, and your website will be deployed to your account's root folder (/public_html)

The "Create a New Repository" section in hPanel at Hostinger

The install path directory must not contain any files or folders; otherwise, deployment will fail 💡

Once you add a New Repository to the account, you will be presented with four buttons:

The "Manage Repositories" section in hPanel at Hostinger
  1. Deploys your already created repository

  2. Allows you to continuously and automatically deploy your projects each time you push new commits to your repository

  3. Shows the latest build output

  4. Deletes the selected repository

How to Use a Webhook URL

You can use the Webhook URL for Auto Deployment to merge a selected Git branch. You will be given a Webhook URL once you press the Auto-Deployment button:

Auto Deployment Setup

Webhooks allow you to build or set up integrations that subscribe to certain events on GitHub. When one of those events is triggered, the scenario will start. Webhooks can be used to update an external issue tracker, update a backup mirror, or even deploy to your production server. You're only limited by your imagination 😊

During the setup, you will be given external links on how to create a Webhook URL. This feature is very useful, for example, if a composer.json file exists, composer update will run automatically as well.

Did this answer your question?