To install a website from a Git repository in cPanel, follow these steps:
- Log in to cPanel.
- Open the Git Version Control tool.
- On the Git Version Control page, click "Create".
- Confirm that the "Clone a Repository" slider is enabled.
- In the "Clone URL" text box, enter the URL of the repository you want to clone.
- In the "Repository Path" text box, specify the path to the document root of the site.
- In the "Repository Name" text box, provide a descriptive name for your repository.
- Click "Create".
After completing these steps, the website will be installed in the document root directory, and you will see the index.html file and a .git directory containing Git files.
To update the website from the Git repository, follow these steps:
- Log in to cPanel.
- Open the Git Version Control tool.
- Locate the repository you want to update and click "Manage":
- Click the "Pull or Deploy" tab, :
- Click "Update from Remote", :
The updated files will be pulled from the remote repository and will replace the existing files in the document root directory.
If you need to clone a private repository, you will need to use an SSH key pair and the SSH protocol in the clone URL. Here's how:
- Create an SSH key pair on your Turnuphosting account.
- View the text of the public key.
- Add the SSH public key to your Git provider.
- Test the SSH connection to the Git provider.
- In cPanel, open the Git Version Control tool and click "Create".
- Enter the clone URL using the ssh:// protocol.
- Specify the repository path, repository name, and click "Create", example :
cPanel will clone the private repository using the SSH protocol and the specified settings. To update the repository, follow the steps mentioned earlier.
By following these instructions, you can easily install and update a website from a Git repository in cPanel.