Install Git on Linux

In the last tutorial, we have learned how to install Git on Mac OS. Now we will learn how to install Git on Unix based operating system like Linux, Ubuntu, Debian, CentOS, OpenSUSE, Fedora, Mint, Manjaro, Zorin, Arch, etc.

How to Install Git on Linux Operating System

Installing git on Unix based system is fairly simple if you tend to use a package manager such as apt-get or yum. Git can be installed pretty quick.

If not it can be really time-taking and too much of effort if you choose to install it without a package manager.

Manually, you can choose to install Git by downloading the TarBall(tar.gz) file, uncompressing it, and append the system’s PATH with Git binary folder.

We focus installing git the easy way here, as it is maintainable and easy to do.

Installing Git the Easiest way

1.) Detect which Linux Distribution your system is running at

https://en.wikipedia.org/wiki/List_of_Linux_distributions

Most of the system would be (including Ubuntu) Debian based.

2.)  Below guide helps you to install Git on different flavors of UNIX systems.

I. For Debian based Unix Machines

Fire up a “terminal” and enter the below commands one by one

$ sudo apt-get update

The above command does a refresh to point out to latest packages for apt-get package manager

$ sudo apt-get install git
The above calls out apt-get package manager to install git for you. You will be required to enter your administrator password, as you are using sudo command.

To confirm if the git has been installed correctly, close and fire up a terminal again, and enter “git”.
You will be able to see the help options presented to you by the git.

II. For Red-Hat based Unix System

Open up a “terminal” and enter the below commands.

$ sudo yum upgrade

The above updates the yum package manager to be able to fetch the latest version of the package(s).

$ sudo yum install git

The above will call out a yum installer to install Git on your machine.

To check if Git is properly installed, fire up a terminal again, and enter “git”.
This will show up a help command to start with Git, if this works, you have successfully installed git in your machine.

Conclusion

In this tutorial, we have learned how to install Git on Linux or how to install Git on Unix based operating system like Linux, Ubuntu, Debian, CentOS, OpenSUSE, Fedora, Mint, Manjaro, Zorin, Arch, etc. The installation is very easy. In the next tutorials, we will cover how to use Git using the GitHub desktop application.

References

https://git-scm.com/download/linux

Translate »