How To Install And Setup Git In Linux
Tags: opensource, howto, linux, ubuntu
Published: 2019-09-04 09:46:58

---
title: How To Install And Setup Git In Linux
published: true 
tags: FOSS,HowTo,Linux,Ubuntu
canonical_url: https://fossnaija.com/how-to-install-git-in-linux/
---

![how to install git banner](https://i1.wp.com/fossnaija.com/wp-content/uploads/2019/08/git.jpg?fit=665%2C394&ssl=1)

## What is git?

Git is a distributed code revision software created by [Linus Torvalds](https://en.wikipedia.org/wiki/Linus_Torvalds), (yes the creator of [Linux](https://dev.to/xeroxism/why-linux-works-d6b-temp-slug-8682900)). Git is used in project/source code version control.

That simply means that it ensures that you can save your work (any [coding project](https://fossnaija.com/wp-content/uploads/2017/08/fossnaija_logo.png)) 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.

Cool right?

Before you can use all the features of git, you’ll have to [install](https://fossnaija.com/installing-software-on-linux-using-gui/) and set it up in your Linux system. So let’s see how we’ll go about this.

Updateyour system

```
sudo apt-get update
```

Installgit Software:

```
sudo apt-get install git
```

Checkthe version of git you just installed:

```
git –version
```

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

```
git version 2.3.2
```

## First TimeConfigurations

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 “john-doe@email.com”
```

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.

## When you need help!

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

```
git help
```

or

```
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.

**Happy Linux’NG!**

The post [How To Install And Setup Git In Linux](https://fossnaija.com/how-to-install-git-in-linux/) appeared first on [Foss Naija](https://fossnaija.com).