The git utility is used to manage Git repositories of a domain through CLI.

Note: This utility is available when the Git extension is installed in Plesk and is used with the plesk ext utility.

By using this utility, you can perform the following tasks:

  • view the list of all Git repositories on a domain or on all domains
  • create or remove a Git repository
  • update a Git repository settings
  • get information on a Git repository
  • deploy changes from a Git repository to a target directory
  • fetch a remote Git repostory for a Git repository of the Using remote Git hosting type
  • get public key of a domain
  • get information on the last commit to a Git repository

For details about using Git repositories, refer to the Administrator’s guide.

Usage

plesk ext git <command> [
<option_1> [<param>]
[<option_2> [<param>]]
... [<option_N> [<param>]]
]

Example

The following command creates Git repository example1 of the Using local repository type for the domain example.com:

plesk ext git --create -domain example.com -name example1

Commands

Command Description Example
--list

Displays the list of Git repositories on all domains (by default).

To display repositories on a specific domain, use with the -domain option.

To display the list of Git repositories of the domain example.com

plesk ext git --list -domain example.com

--create

Creates a repository.

Used with the -domain and the -name options. For repositories of the Using remote Git hosting type, the -remote-url option is required.

Optionally, can be used with the following options: -deployment-path, -remote-ur l, -deployment-mode, -skip-ssl-verification, -actions-file.

To create the push repository of the Using local repository type on the domain domain.com:

plesk ext git --create -domain domain.com -name push

To create the pull repository of the Using remote Git hosting type associated with the remote repository http://code.pp.plesk.ru/plesk/demo.git on the domain domain.com:

plesk ext git --create -domain domain.com -name pull -remote-url http://code.pp.plesk.ru/plesk/demo.git

--info

Displays repository settings.

Used with the -domain and the -name options.

To get information about the push repository on the domain domain.com:

plesk ext git --info -domain domain.com -name push

--update

Updates repository settings.

Used with the -domain and the -name options. Additionally, at least one of the following options should be used: -new-name, -deployment-path, -remote-url, -active-branch, -deployment-mode, -skip-ssl-verification, -actions-file.

To update the name and to switch on the manual deployment mode for the repository demo1 on the domain domain.com:

plesk ext git --update -domain domain.com -name demo1 -new-name demo2 -deployment-mode manual

--remove

Removes a repository.

Used with the -domain and the -name options.

To remove the repository demo from the domain domain.com:

plesk ext git --remove -domain domain.com -name demo

--deploy

Deploys changes from a repository to a target directory.

Used with the -domain and the -name options.

To deploy changes from the repository demo on the domain domain.com:

plesk ext git --deploy -domain domain.com -name demo

--fetch

Fetches a remote repository. This is applicable only for repositories of the Using remote Git hosting type.

Used with the -domain and the -name options.

To fetch a remote repository for the repository demo on the domain domain.com:

.. code-block:: guess

plesk ext git –fetch -domain domain.com -name demo
--get-last-commit

Displays the information about the last commit.

Used with the -domain and the -name options.

To get the information about the last commit for the repository demo on the domain domain.com:

plesk ext git --get-last-commit -domain domain.com -name demo

--help Displays help on the use of the utility.

To view the help information on the use of this utility:

plesk ext git --help

or

plesk ext git -h

Options

Option Parameter Description Example
-domain <domain>

Domain name.

Used with the following commands: --create, --list, --update, --remove, --info, --deploy, --fetch, --get-last-commit.

To get information about the push repository on the domain domain.com:

plesk ext git --info -domain domain.com -name push

-name <repository name>

Repository name.

Used with the following commands: --create, --update, --remove, --info, --deploy, --fetch, --get-last-commit.

To create the push repository on the domain domain.com:

plesk ext git --create -domain domain.com -name push

-new-name <new repository name>

New repository name.

Used with the --update command.

To update name for the repository demo1 on the domain domain.com:

plesk ext git --update -domain domain.com -name demo1 -new-name demo2

-deployment-path <deployment path>

Deployment path.

Used with the --create and the --update commands.

To update the deployment path for the repository example1 on the domain example.com:

plesk ext git --update -domain example.com -name example1 -deployment-path /httpdocs/test/

-remote-url <remote url>

URL of a remote Git repository.

Used with the --create command, applicable to the repositories of the Using remote Git hosting type only.

To create the pull repository of the Using remote Git hosting type associated with the remote repository http://code.pp.plesk.ru/plesk/demo.git on the domain domain.com:

plesk ext git --create -domain domain.com -name pull -remote-url http://code.pp.plesk.ru/plesk/demo.git

-active-branch <active branch>

Active branch.

Used with the --update command.

To change the active branch of the repository example on the domain example.com:

plesk ext git --update -domain example.com -name example -active-branch dev

-deployment-mode <auto|manual|none>

Switching the deployment mode: automatic deployment (auto), manual deployment (manual), or no deployment (none).

Used with the --create and the --update commands.

To switch on the automated deployment for the repository example on the domain example.com:

plesk ext git --update -domain example.com -name example -deployment-mode auto

-skip-ssl-verification <true|false>

Switching skipping SSL/TLS verification on (true) or off (false).

Used with the --create and the --update commands, applicable to the repositories of the Using remote Git hosting type only.

To skip SSL/TLS verification for the repository example1 on the domain example.com:

plesk ext git --update -domain example.com -name example1 -skip-ssl-verification true

-actions </path/to/actions-file.txt>

Path to the file with additional deployment actions.

Use with the --create and the --update commands.

To create the repository repo1 on the domain example.com with the additional deployment actions listed in the file actions.txt:

plesk ext git -c -domain example.com -name repo1 -actions ./actions.txt