Set-up Git™ Version Control

What is Git

Git is a version control system that tracks file changes that multiple users can edit simultaneously. This is essential when collaborating with multiple developers on a project, allowing easy updating, tracking, management and control.  

Here are some essential concepts to understand

  • Repository or Repo is used to track changes made throughout the project folder via the .git file. This file can exist locally (on your device) and remotely allowing remote updates by multiple developers.
  • Branch or branches, by default there is a master branch but different branches can be created to make changes that will not impact another branch. This also aids in collaboration and helps alleviate risks. 
  • Commit, every time you make a change to a branch you can submit this change as a commit which is a standalone version of a project. 
  • Push and Pull, are used to submit or receive changes from local to remote and vice versa. 
  • Merge – Used to merge two branches, usually into the master branch.

Do not delete the .git file, this is required to use Git

Set it up in cPanel

1. Login to cPanel.2. Navigate to the files section.

cPanel File Section

3. Click git version control, here you can see any repos in your cpanel account.

Git Version Control cPanel

4Click Create, this will create a repo.

Git Version Control

5. From here, you have two choices:

5.1. You can untick clone a repository and create a new repository.

Create Repo

5.2. Or, you can choose to clone a repo i.e. (from GitHub) this means you create a copy of a repo you own. To do this enter a clone for the repo from GitHub or GitLab. 

Git Clone Repo

6. Enter your desired path for the repository. 

Repo Path

7. Enter a repository name.

If you want to create multiple repositories tick the create another repository checkbox.

8. Click Create, if cloning a large repository this might take some time.

Create Repo

Using Git Version Control in cPanel 

Manage

You can click manage on a repository to update its settings.

Git Manage
  • Click Manage to reveal the management interface
  • Basic Information – Edit name or checkout branch
  • Information pane – View information on the current branch including the history
Git Manage Overview

History

History lets you view the repo’s history and files 

Git History

Remove

Remove lets you remove the repo from under the cPanel Version control tool, this will not remove the files

Git Remove

Drop down arrow

Clicking the drop-down arrow lets you view more details about the repository, visit the directory it’s stored in on your account and has a clone URL.