Signup/Sign In
PUBLISHED ON: AUGUST 23, 2021

Installing Git on Linux

Linux is a popular and widely used operating system. Installing Git on Linux is a lot simpler as compared to other platforms. We just need to use the appropriate package manager for our Linux distribution.

In this tutorial, we will see how to install and set up Git on various distributions of the Linux operating systems.

For Debian/Ubuntu

Run the following command on the shell/terminal to install Git in Linux.

$ sudo apt-get install git

To check whether Git was successfully installed, use to --version command:

$ git --version

For Fedora, CentOS and RHEL

Run the following command from the shell/terminal:

$ sudo dnf install git

If using an older version then use yum instead of dnf:

$ sudo yum install git

For OpenSUSE

Open the shell and run the following command to install Git on OpenSUSE:

$ sudo zypper install git

For Arch and its derivatives

Run the following pacman command in the shell to install Git:

$ sudo pacman -S git

For Mageia

Use the urpmi command in the shell to install Git:

$ sudo urpmi git

To check if Git was successfully installed, run the --version command:

$ git --version

If the above command displays the git version as shown below then Git was successfully installed.

git version command output

Summary

Congrats on successfully installing Git on your Linux system. We are now ready to start working on Git and manage our projects using Git.

In the next tutorial, we will see how to create a new repository or a project using Git. I hope this tutorial was helpful and you learned something new.



About the author:
I like writing content about C/C++, DBMS, Java, Docker, general How-tos, Linux, PHP, Java, Go lang, Cloud, and Web development. I have 10 years of diverse experience in software development. Founder @ Studytonight