That simply means that it ensures that you can save your work (any coding project) at a particular point in time – versions. Each _ save _ is called, in git’s parlance, _ commit _.
You can therefore loadyour project from any commit you’ve have done. In essence you’dbe able to control the “versions” of of your project you want towork with.
One of the advantages ofthis practice (committing code) is that in an event of mishap –either due to a development flaw or mistake, you can simply load aprevious version of your projects instead of starting from thescratch again.
Before you can use all the features of git, you’ll have to install and set it up in your Linux system. So let’s see how we’ll go about this.
sudo apt-get update
sudo apt-get install git
Checkthe version of git you just installed:
If you got git installedcorrectly you’d get an output similar to:
git version 2.3.2
Since you’ve gitinstalled, it is now important to set some global variables. Thesevariables are important because it helps git to identify who ismaking changes to a particular code-base.
And it will also helpdevelopers identify you would, maybe in the future, you want tocontribute to other people’s codes. The most common form ofidentification are names (i.e. username) and email. You can set theseconfiguration in git like this:
git config -–global user.name “John” git config –-global user.email “firstname.lastname@example.org”
Check the all yourconfiguration values;
git config –list
Remember that the mostimportant variables you should be concern about are username andemail, especially at a beginner’s stage. Maybe later when you wantto do intermediary to advanced stuffs you would probably have becomefamiliar with the necessary configuration settings you might need.
To see an overview of thegit sub-commands and syntax you can enter the command on theterminal:
git help -a
For git concept guide use:
git help -g
To see what you can dowith the various git command (actions) or concepts you can simply thefollowing format.
git help "command" git help "concept"
You can use git now onlocal computer to tract you projects/code changes.
You can download a gitcheat-sheet to learn the most important git commands you can workwith.