To create a new directory to store your repository, run the following command:

mkdir -p ~/Project/example

To navigate to the newly-created directory, run the following command:

cd ~/Project/example

To initialize the directory as a Git repository, run the following command:

git init

Update the repository's Git configuration.

This optional step configures the Git repository to remain up to date as you push changes from the local branch. For more information about Git's configuration file and its options, read Git's git-config documentation.

To update the configuration, run the following command from within the repository directory:

git config receive.denyCurrentBranch updateInstead

Clone the repository locally.

To clone the cPanel-account-hosted repository, access your local computer via the command line and run the following command:

git clone ssh://username@hostname:/home/username/Project/example.git

username represents the cPanel account username.

hostname represents the hostname for the server that hosts your cPanel account.

Clone an existing repository to your cPanel account.

If a Git repository already exists for your project, you can clone it and host it on your cPanel account.

To clone an existing repository, perform the following steps:

Use SSH to log in to your cPanel account on the command line.

To create a new directory to store your repository, run the following command:

mkdir -p ~/Project

To navigate to the newly-created directory, run the following command:

cd ~/Project

To clone the repository, run the following command, where url represents the full Git URL of the existing repository to clone:

git clone url example.git

Note:

Many developers host their code repositories on GitHub. GitHub repository URLs generally resemble the following example, where Account represents the GitHub account name and example represents the repository name:

https://github.com/Account/example.git

Push local changes to the hosted repository.

After you finish this tutorial, you can make changes to the repository's files on your local computer. You must run the following command in order to push changes that you make on your local computer to the hosted repository:

cPanel, WebHost Manager, and WHM are registered trademarks of cPanel, Inc. for providing its computer software that facilitates the management and configuration of Internet web servers. ®2016 All rights reserved.