Get a free website with any plan

See how
CPANEL

Git Version Control in cPanel: create and clone repos

Last updated

IN SHORT

Flashcloud hosting includes cPanel's Git Version Control tool to create repositories directly on your server or clone them from existing remotes. You can pull updates manually or push from local machines. To ensure your site is reachable online, you must set the repository path to your domain's document root.

cPanel's Git Version Control tool creates a repository directly on your server, or clones one you already have. Use it when the server itself should hold the canonical repo, or when you want a working copy on the server you can pull updates into by hand.

Create a new repository

Open cPanel (see the SSO tile in your hosting service if you're not sure how to get in), then find Git Version Control under Files. From there you can create a new repository at a path of your choosing, or clone one from an existing remote.

An empty repo isn't useful until you have commits in it. If you're starting a new project, the simplest path is to connect over SSH, work in the repository path directly, and commit as you go. If you'd rather develop locally and push up, add the server as a remote from your local machine and push to it.

Clone an existing repository

If your code already lives in GitHub, GitLab, Bitbucket, or any git server you can reach, the same tool can clone it directly to a path on your server. For a private repo, use the SSH clone URL and make sure your server's SSH key is added on the git host's side, since a password prompt has nowhere to go in this flow.

From there it behaves like any git working copy: you can switch branches, view commits, and pull again from the repository's management page when the remote updates.

Where files need to land

The repository path has to match your web server's document root or the app won't be reachable at your domain, so clone or create into that folder rather than an arbitrary one. Subdomains and addon domains each have their own document root, so target that folder rather than the top level. If your project needs a build step before it's servable, cloning the source isn't enough by itself; you still need the built output sitting in the document root. See Deploying a Laravel app for a concrete example of a framework with this exact requirement.

Other ways to deploy

The cPanel tool covers the case where you want a repo that lives on the server itself, you're managing pulls yourself over SSH, or you're initializing a brand-new project without a remote yet. For a portal-based Git deployment workflow, see Deploying with Git.

For getting files onto the server by other means, like a single upload rather than a full repo, see Deploying a Node.js app and the file manager and FTP/SFTP options it links to.

When to contact support

If a clone fails with an authentication error against a private repo, or a repository won't initialize at the path you chose, open a ticket from Support in the portal.

Common questions

Why is my site not loading after cloning my repo?

Your repository path does not match your document root. Files must sit inside the specific document root folder for your domain or subdomain to be reachable online.

Why does my private repository fail to clone?

You are likely facing an authentication error. Private repositories require an SSH clone URL and your server's SSH key added to your git host, as cPanel cannot accept password prompts.

Can I clone code from GitHub, GitLab, or Bitbucket?

Yes, you can clone from any accessible git host. Enter the remote URL into the cPanel tool and choose your destination directory.

Why is my cloned application broken even though the files are there?

Your project may require a build step before it can run. Cloning raw source files is not enough if your framework expects compiled build output inside the document root.

CAN'T FIND IT?

Real humans answer fast.

Hosting with us? Open a ticket and a real person replies - no scripts, no upsells. Still choosing a host? The same team is included with every plan, from day one.