How To Install Git

We already know basic What is Git in previous tutorial. Next We will do the installation and preparation to start learning Git.

This tutorial is divided into three parts:

  • How to Install Git on Linux.
  • How to Install Git on Windows.
  • The initial configuration must be done after installing Git.

How to Install Git on Linux

On the Debian/Ubuntu distro family you can use the command apt to install latest Git release.

# apt-get install git

For Ubuntu, this PPA provides the latest stable upstream Git version:

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

For Fedora release:

# yum install git (up to Fedora 21)

# dnf install git (Fedora 22 and later)

Gentoo release:

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

Arch Linux release:

# pacman -S git

openSUSE release:

# zypper install git

Mageia release:

# urpmi git

Nix/NixOS release:

# nix-env -i git

FreeBSD release:

#pkg install git

Solaris 9/10/11 (OpenCSW) release:

#pkgutil -i git

Solaris 11 Express release:

# pkg install developer/versioning/git

OpenBSD release:

# pkg_add git

Alpine release:

$ apk add git

Red Hat Enterprise Linux, Oracle Linux, CentOS, Scientific Linux, et al. RHEL and derivatives typically ship older versions of git. You can build from source by downloading a tarball source, or use a 3rd party repository such as the IUS Community Project to obtain a more recent version of git.

Slitaz release:

$ tazpkg get-install gi

To verify which Git version installed, you can type this command:

See also  A tutorial on configuring Apache Virtual Hosts on CentOS 8

# git --version

On my computer, git version installed is 2.17.0

Git Version

How to Install Git on Windows

Navigate to : and get the latest installer version, you can use either 32 bit or 64 bit version depends on your system. The installation is easy because you only need to follow the installation wizard, and you good to go to use git. But, there are some step you need to do if you want to use Git in windows command line.

Following step will guide you to install Git on Windows.

After you have download the installer from link above, launch it and the installation wizard will show up. You only need to follow “Next and next process”.

Select additional components that you need to installed.

Select the default text editor that you prefer.

Select the default option to add PATH environment, so you can run git from command line.

Choose SSL Library which will be used for HTTPS transport backend connection.

Select default option to convert the line ending from LF to CRLF when checking out text files. When committing text files, CRLF will be converted to LF. For cross-platform projects, this is the recommended setting on Windows.

Choose default option to use MinTTY as default terminal emulator.

Select which extra features would you like to enable.

Wait while installer is still in progress.

You can now hit Finish button when finished.

See also  Using the W command in Linux Terminal

Well done. You have installed Git Windows. Now try to verify git version in command line. (Shortcut Windows+R, and type cmd press enter).

Next step, you will learn how to add repository.

About wahyuway

Check Also

How To Deploy Droplet on DigitalOcean With Terraform

Hello good people. In today’s blog post we will be showing you how to create …

Leave a Reply