cart cart FAQ Support

Do all of your Git stuff right from within your hosting account? Yes. With cPanel you can now host a private or public repository without paying premium costs to third party Git hosting services like GitHub or BitBucket.

 

While Git Version Control is available in all of our hosting accounts, we’d recommend a VPS or Dedicated hosting package, so you can exercise more control over individual shell user privileges. This is especially important if you plan on having other users access your Git repository.

 

Be very careful creating a repository in a directory that already contains files. If, for some reason, you delete the repository from cPanel, the whole directory will be erased!

How to Create a Git Repository with cPanel

In this first part we’re creating a new repository. Later, we’ll show you how you can “clone” an existing repository instead.

If you’re creating a repository for the first time, you’ll be prompted to fill in the necessary fields right away. Otherwise, you’ll just need to click the blue Create button. These steps are detailed below:

  • Log into cPanel
  • Select Git Version Control under Files
  • Click Create (if you haven’t created any repositories yet, you’ll be skipped ahead to the next step automatically)
  • Toggle off the Clone a Repository button
  • Fill in the file path to the new repository
  • Provide a name for the repository as it will appear in your cPanel interface
  • Click Create at the bottom

Now, cPanel will create the repository and provide you with some helpful Git commands you can run in a shell session in order to use this repository.

How to “Clone” a Git Repository in cPanel

Instead of creating your own Git repository, you can “clone” a repository that already exists out on the Web: for example, from the popular Git hosting site GitHub.

  • Log into cPanel
  • Select Git Version Control under Files
  • Copy the clone URL into the Clone URL
  • Fill in a file path for the repository (remember the cloned repository provides its own directory)
  • Fill in a name for the repository as it will appear in your cPanel interface
  • Click Create

Now you have successfully cloned a repository into your hosting account. This is a great way of cloning in a homepage you may have under version control at a different location or just a repository of various scripts or assets you may need for a project.

How To Clone a Git Repository To Your Local Computer

One of the most important aspects of managing a project in Git is being able to sync the remote repository with your local work.  This process will be a little different for VPS and shared hosting users.

The best way to clone a Git repository is to use the default SSH connection.  The shared hosting server uses port 2006. 

For shared hosting, you will just need to specify the port:

git clone ssh://userna5@example.com:2006/home/username/test-git-site

“Permission Denied” Error

If you encounter a “permission denied” error when trying to clone a private repository (from GitHub or other provider) you will need to register an SSH key on your server for this purpose. 

Why Create a Git Repository in cPanel

It’s true that you can launch your own repository wherever you have Git installed. However, cPanel makes the process much easier by creating the repository and the necessary executable files to save and launch your project right away.

Manage Projects With Ease

We’ve gone into some depth explaining how Git works in our Git tutorial series. But if you want a closer look to see how Git can work for you, you can now easily set up a Git repository with any of our cPanel hosting accounts.

Helpful Commands Delivered

cPanel gives you the essential commands you’ll need to get started the instant you’ve created your repository.


cPanel Hosting Linux Shared Hosting Merchant Accounts Merchant Accounts Merchant Accounts PayPal

Account Management

Support Helpdesk

Web Hosting

Semi-Dedicated Servers

Domain Names

Dedicated Servers

Other Services

Datacenters