The software versioning system Git is not installed by default on Linux, Windows, and MacOS operating systems.

Even if Git has already been installed, it’s a good idea to update to the latest version.

Each system has a different way to perform the installation, and by default, after installation, Git commands are available through the command line or terminal console. You can install it as a package or through another installer, or even download the source code and compile it.

Below you will see how to install Git on the main operating systems and in different Linux distributions.

Also see

How to set username and email per project with Git

Installing Git on Windows

There are some ways to install Git on Windows. The most official version is available for download from the Git website.

Access the address https://git-scm.com/download/win and the download will start automatically. Note that this is a project called Git for Windows, which is separated from GIT’s main project itself; for more information about it, go to the page https://gitforwindows.org.

To download an automated installation, you can use the Git Chocolatey. Observe that the Chocolatey package is maintained by the community. Even so, each version of each package goes through a strict moderation process before airing, which normally includes:

  • Quality Safety, Consistency and Verification
  • Installation test
  • Virus verification through Virustotal
  • Moderation by humans who perform the final revision and sign them

One more way to install Git on Windows is by installing the Github for Windows. The installer includes a GIT control line version as well as the Gui.

It also works well with Powershell, and sets the solid credential cache and the appropriate CRLF settings.

In other articles/lessons I will deal with credentials and configurations CRLV

You can download it from the Github page to Windows, in https://windows.github.com.

Installing Git on MacOs

As at Windows, there are several ways to install Git on a Mac. The easiest is to install the Xcode command line tools.

In Mavericks (10.9) or above, you can do this by simply running the git command on the terminal console for the first time. If it is not installed the system will ask you to install it.

If you want to work with the most up-to-date version, usually not available at the same speed in repositories, you can install it using a binary installer.

An OSX GIT installer is kept and made available for download on the Git website, go to the address http://git-scm.com/download/mac to download the installer.

GIT INSTALLATION SCREEN IN MAC OSX
GIT INSTALLATION SCREEN IN MAC OSX

You can also install it as part of the Github installer to MacOs. Your Gui Git tool has an option to install the command line tools.

To download this tool access the Github page to Mac, in http://mac.github.com.

Installing Git on Linux

The GIT installation process in Linux / Unix is usually done through the basic package management tool that comes with its distribution.

GIT is an essential tool for developers and infrastructure, Devops, packages for your installation are always present and well updated.

Installing Git on Linux Fedora

For Linux distributions that use the yum package manager, such as Linux Fedora for example, you can use the following command:

sudo yum install git-all

Using yum will work for Fedora to version 21, for Fedora 22 and younger use dnf:

dnf install git

Installing Git on Linux Debian, Ubuntu, Mint

If you use a Liux Debian-based distribution like Ubuntu or Mint, use the apt-get package manager:

sudo apt-get install git-all

You can use the following official repository for the latest versions, should work for the three Debian based distributions:

add-apt-repository ppa:git-core/ppa
apt update
apt install git

Installing Git on Linux Gentoo

emerge --ask --verbose dev-vcs/git

Installing Git on Arch Linux

pacman -S git

Installing Git on Linux OpenSUSE

zypper install git

Installing Git on Linux Mageia

urpmi git

Installing Git on Nix/NixOS

nix-env -i git

Installing Git on FreeBSD

pkg install git

Installing Git on Solaris 9/10/11 (OpenCSW)

pkgutil -i git

Installing Git on Solaris 11 Express

pkg install developer/versioning/git

Installing Git on Linux OpenBSD

pkg_add git

Installing Git on Linux Alpine

apk add git

Installing Git on Linux Red Hat Enterprise Linux, Oracle Linux, CentOS, Scientific Linux, et al.

Rhel and derivatives usually provide older versions of GIT. You can download one tarball and compile from the source code or use a third party repository, such as the IUS Community Project to get a newer version of Git.


Test the Git installation

After running one of the installation commands, according to your operating system GIT will be available.

To test if the installation worked, you can check the GIT version with the following command:

git --version

Conclusions

Install Git is an easy proccess on any operational system. Do it and start geting the benefitisInstalling Git is very simple on all operating systems. So install it and start receiving the benefits of software versioning.