cPanel Git Version Control – Introduction
cPanel has introduced a new feature called Git Version Control in its latest update to version 72. While git is largely popular with the development community and some advanced users it is a fairly new feature for the average cPanel user. Over the course of the next few blog posts, we would introduce git in general along with cPanel’s implementation of Git Version Control.
Let us start with Git.
What is Git?
Git is a version control software. While using Git whenever you make some changes in a Git-managed content such as code, text files or any content that is managed by git, it records the changes and stores the history of each and every change you have made. Git doesn’t store data as a series of changesets or deltas, it stores the data as a series of snapshots.
Git was designed for the Linux kernel, and it is very helpful for software developers. You can use Git for any project which is stored as files, like website design or document storage etc.
What are repositories?
Git stores all project data in databases called repositories. With the new cPanel feature, you can create a git repository on your cPanel account, or you can copy your existing repository. While working with Git, you can use a single repository for your project, or you can use a more complicated structure as per your requirement.
What are branches?
Branches are mainly used to differentiate the line the development by branching changes off from the main repository’s history. Git is very flexible as it allows you to use branches so you can manage them, it is very helpful for your team. With Git, each team member could have their own branch, or they can work on the same project-specific branch.
Git has very simple commands which allow you to get changes and branches from your remote repository. It also allows you to have repositories or branches which exists in your cPanel account. Git allows you to switch between the branches and manage them as per your requirement. You can access your team members changes (Pull) so you can combine them into your copy of the project.
What are commits?
Once the changes are made, you can send them to your main repository so that others can access them. In order to do this, you need to commit your changes.
Commits save your changes with author information along with other change histories. When you commit the changes, you create a commit message to send with them. Once everything is set with your commit, you push your changes to the main repository.
Features of Git
Following are some simple uses of Git, but there are lots of other features. You can check official Git’s documents for that.
– With Git, you can find the differences between two revisions.
– You can view the line-by-line change history of a file which allows you to locate any changes or who the author was.
– You can find the log information of the commit author, date, and message.
– You can edit files and the changes before or after you push them.
– It allows you to resolve merge conflicts when changes are made.
– You can find out when the bugs were found using bisecting.
Git is supported on all our WordPress hosting plans.
This blog post was to get you familiar with the terminology associated with Git and in our next post, we will perform some repository related functions such as create, pull, push, commit and others.