Skip to main content

[Plesk] How To Use Git in Plesk

In this guide we will show how you can use both Local and Remote Git in your Plesk

Updated over 2 weeks ago

0. Precautions

First, make sure Git extension is installed in your Plesk. It is typically installed by default. You can confirm this by visiting Extensions--->My Extensions.

If it's not installed for some reason, find it in Extensions search and install. GIt extension is free in Plesk.

1. Find Git in Plesk

Navigate to the Website & Domains section:

Find Git icon and click on it:

Then, click "Add Repository". If this is first time, you trying to add Git repository in Plesk, page will look like this:

2. Add Git Repository

In Plesk you can create remote or local Git repository.

Remote Git repository means the primary repo lives on an external service like GitHub, GitLab, or Bitbucket, and Plesk pulls from that source to deploy based on your chosen deployment mode.

A local Git repository means the origin is hosted directly on your Plesk server, so you push to Plesk itself and it deploys from there.

2.1 Add remote repository

On the "Create repository" page select remote repository:

Specify the path to your remote repository, repository name and server path (directory where the files will be deployed)l. If the repository uses HTTP Basic authentication, enter the credentials below.

Then, select deployment mode. It controls how code from your repo is copied to your site’s web directory. Three different options are available:

  • Automatic - any changes pushed to the Git repository are deployed to the production site automatically.

  • Manual - if you choose Manual deployment, you must deploy the files from the Git repository to your hosting yourself.

  • Disabled - no files are deployed to production. You can use this to keep and exchange code safely off the live site.

You can also enable additional deployment actions by selecting the checkbox. Then, type each command on a new line in the provided field.

After entering all details, click "Create".

2.2 Add local repository

On the "Create repository" page select local repository:

As with a remote repository, enter the remote URL, set the repository name, choose the server path for deployment, and select the deployment mode.

You can add more users in Plesk "User Accounts", and they will be able to pull and push over HTTP or HTTPS. You can do this later and select them in the repository settings.

As with a remote repository, you can enable additional deployment actions by checking the box. Then enter each command on a separate line in the designated field.

When you have filled in everything, select "Create".

New repository will appear in the Website & Domains---->Your website----->Git.

Did this answer your question?