How to Create a Git Repository on Your Reseller VPS

Your reseller customers can use Git for all kinds of projects, whether they’re moving around static files or managing WordPress theme updates. If they want to use Git, let them use Git! But maybe they don’t know how to open and sync with their own self-hosted repository. This is where you can save the day for them! In this article, we’re going to show you how to create Git repositories if you resell VPS space or if you have a managed dedicated server.

How to Add a Git Repository in cPanel

You can easily add a Git repository from within any cPanel account.

  1. Log into cPanel
  2. Select Git Version Control under Files
  3. Click Create
  4. Uncheck Clone a Repository (unless you actually are cloning a repository)
  5. Fill in a Directory path and Name for the new repository
  6. Click Create

That’s it! cPanel will provide a list of helpful commands you can use right away to use the new repository. Remember, if you destroy a repository from within cPanel, you will erase all of the files with it.

Initialize a Git Repository Manually

If you’re already quite familiar with Git, you can manually create repositories on the command line. The procedure is slightly different:

  1. Log into VPS via SSH
  2. Create a directory for the repository
  3. Enter the directory and run
    git init --bare

All of these steps are covered in detail in our full guide on using Git to publish files.

Putting it All Together

We’ve now presented you with two different ways to set up Git repositories in your Reseller VPS hosting environment:

  • Through the cPanel
  • Manual Git initialization

If you’re excited to start using Git on your server, be sure our full Git guide to get up to speed, get a refresher, or just find out exactly what Git is and how you can use it.

Christopher Maiorana Content Writer II

Christopher Maiorana joined the InMotion community team in 2015 and regularly dispenses tips and tricks in the Support Center, Community Q&A, and the InMotion Hosting Blog.

More Articles by Christopher

Was this article helpful? Join the conversation!