Appendix:
- How to clone git repository to plesk.
- How to change git branch.
- How to enable auto deployment.
How to clone git repository to plesk.
- Go to the desired domain or sub domain.
- Click on Git icon (fig. 1.1).
- Click on Add Repository.
- Click on Remote Repository (fig. 1.2).
- Enter your git repository ssh link.
- Copy ssh key.
- Go to your git repository settings page (i.e github).
- Settings > Deploy Keys > Add New.
- For the title: enter a name to remember which this key refers to (i.e. serv50 or you can use the domain name sub.domain.com).
- Paste the ssh key that you copied from Plesk.
- Go to plesk again and submit the add repository form.
![](https://elkhayyat.me/wp-content/uploads/2024/04/image-1024x911.png)
![](https://elkhayyat.me/wp-content/uploads/2024/04/image-1-959x1024.png)
![](https://elkhayyat.me/wp-content/uploads/2024/04/image-2-1024x676.png)
Now your repository is linked to your domain. and your main branch is updated. If you want to manual pull from git click on Pull now.
How to change repository setting in plesk.
![](https://elkhayyat.me/wp-content/uploads/2024/04/image-3.png)
How to change the deployed branch.
In some cases you may need to change some settings like change the used branch.
- Go to the plesk repository settings.
- Select the desired branch from Repository branch select menu.
- Click Apply.
How to enable automatic deployment.
- Go to plesk repository settings
- Copy the webhook url.
- Go to your git provider repository settings (i.e. github).
- Go to webhooks.
- Click on Add webhook button.
- Paste the webhook url you copied before from plesk into the Payload URL field.
- Click on Add webhook.
- If your project require running some commands after pull from the server you will need to write the commands in bash script and call it something.sh
- In the Plesk repository setting click on enable additional deployment actions.
- write bash something.sh
- Click on Apply.