How To Install And Setup Git In Linux

By | August 1, 2019
how to install git banner

What is git?

Git is a distributed code revision software created by Linus Torvalds, (yes the creator of Linux). Git is used in project/source code version control.

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 load your project from any commit you’ve have done. In essence you’d be able to control the “versions” of of your project you want to work with.

One of the advantages of this practice (committing code) is that in an event of mishap – either due to a development flaw or mistake, you can simply load a previous version of your projects instead of starting from the scratch again.

Cool right?

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.

Update your system

sudo apt-get update

Install git Software:

sudo apt-get install git

Check the version of git you just installed:

git –version

If you got git installed correctly you’d get an output similar to:

git version 2.3.2

First Time Configurations

Since you’ve git installed, it is now important to set some global variables. These variables are important because it helps git to identify who is making changes to a particular code-base.

And it will also help developers identify you would, maybe in the future, you want to contribute to other people’s codes. The most common form of identification are names (i.e. username) and email. You can set these configuration in git like this:

git config -–global “John”
git config –-global “[email protected]

Check the all your configuration values;

git config –list

Remember that the most important variables you should be concern about are username and email, especially at a beginner’s stage. Maybe later when you want to do intermediary to advanced stuffs you would probably have become familiar with the necessary configuration settings you might need.

MUST READ  Why I have come to love Ubuntu Linux.

When you need help!

To see an overview of the git sub-commands and syntax you can enter the command on the terminal:

git help


git help -a

For git concept guide use:

git help -g

To see what you can do with the various git command (actions) or concepts you can simply the following format.

git help "command"
git help "concept"

You can use git now on local computer to tract you projects/code changes.

You can download a git cheat-sheet to learn the most important git commands you can work with.

Happy Linux’NG!

I agree to have my personal information transfered to MailChimp ( more information )
Join over 10,000 visitors to receive Open Source tips, trick, news, tutorials, programming and more.
We hate spam. Your email address will not be sold or shared with anyone else.

Tell us what you think

This site uses Akismet to reduce spam. Learn how your comment data is processed.