{"id":49033,"date":"2018-05-16T13:00:00","date_gmt":"2018-05-16T18:00:00","guid":{"rendered":"https:\/\/blog.cpanel.com\/?p=49033"},"modified":"2018-05-16T13:00:00","modified_gmt":"2018-05-16T18:00:00","slug":"git-version-control-series-what-is-git","status":"publish","type":"post","link":"https:\/\/devel.www.cpanel.net\/blog\/products\/git-version-control-series-what-is-git\/","title":{"rendered":"Git Version Control series: What is Git?"},"content":{"rendered":"

This is the first in a series of blog posts around Git and a new feature in version 72,\u00a0Git Version Control<\/a>.\u00a0 See the full list of entries in this series at the end of this post!\u00a0<\/em><\/p>\n


\n

If you follow our\u00a0feature request site<\/a>, you already know about our upcoming feature, Git Version Control<\/a>. We’re designing it to make hosting repositories as easy for developers as a “Hello World!” script. Before we send the feature your way, though, we want to make sure you’re familiar with Git.<\/p>\n

What is Git?<\/h3>\n

Git is version control software<\/span>. Whenever you change Git-managed content, Git\u00a0records it\u00a0and<\/strong>\u00a0stores the history of every change you’ve made. Git was designed for the Linux kernel, and it’s great for software developers. That’s not the\u00a0end of what it can do, though. You can use it for any project that’s stored as files, like web design or document storage. There’s even a cPanel employee who uses it for their grocery lists!<\/p>\n

No matter how you use Git, any number of people can work on the same project at the same time\u00a0without<\/strong>\u00a0traffic jams.<\/p>\n

Repositories<\/h3>\n

Git stores your data in databases called repositories.\u00a0 You can create a repository on your cPanel account, or you can copy\u00a0(in Git, “clone”) an existing repository. Our Git Version Control feature will support both options.<\/p>\n

When you work with Git, you can have a single repository for your project, or\u00a0you can have a more complicated structure.<\/p>\n

<\/a><\/p>\n

A simple Git setup using one repository.<\/em><\/p>\n

<\/a><\/p>\n

A multi-layer setup with project-specific repositories that merge into a main repository. cPanel uses this kind of setup. It’s great for projects that have multiple teams working on different things.<\/em><\/p>\n

Branches<\/h3>\n

Branches separate lines of development by “branching” changes off of the main repository’s history. \u00a0Git’s pretty flexible when it comes to how you use branches so you can manage them, however, works best for your team. Each person could have their own branch, or everyone might work on the same task-specific branches.<\/p>\n

<\/a><\/p>\n

Nope, this isn’t a subway map! Just a peek at how Git branching might look over time.<\/em><\/p>\n

You aren’t limited to working on a single branch at a time, either. Simple commands allow you to get changes and branches from the remote repository.\u00a0You can also have repositories or branches that only exist on your cPanel account.<\/span>\u00a0You can switch between\u00a0(in Git, “check out”<\/span>) those branches and manage them as needed. You can grab your teammates’\u00a0changes (in Git, “pulling”)<\/span>\u00a0in real time, too so you can incorporate them into your copy of the project as you go.<\/p>\n

Commits<\/h3>\n

After you make changes, you can send them up to the main repository so that everyone can access them. To do this, you need a commit.<\/p>\n

Commits package up your changes with author information and other change history. When you commit changes, you also create a commit message to send with them.\u00a0(Good commit messages make Git\u00a0really<\/em>\u00a0useful. There are\u00a0<\/span>some<\/span><\/a>\u00a0<\/span>great<\/span><\/a>\u00a0guid<\/span><\/a>es<\/span><\/a>\u00a0to writing good commit messages.)<\/span>\u00a0Once you’ve got everything in your commit, you send\u00a0(in Git, “push”<\/span>) your changes to the main repository.<\/p>\n

Using Git’s full potential<\/h3>\n

This<\/span>\u00a0post only describes the simplest uses of Git, but there are lots of other features to take advantage of! Among other things, you can easily:<\/p>\n