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.
- Log into cPanel
- Select Git Version Control under Files
- Click Create
- Uncheck Clone a Repository (unless you actually are cloning a repository)
- Fill in a Directory path and Name for the new repository
- 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:
- Log into VPS via SSH
- Create a directory for the repository
- 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.