How to install Git in Linux?

  

Linux Git is a handy manager tool. At first Git was developed for Linux and is now used in major systems. This article will introduce how to install Git in Linux system.

Installing Git with the Package Manager

Git is already supported by all major Linux distributions. So the easiest way to install it is to use the package manager for each Linux distribution.

Debian, Ubuntu, or Linux Mint

$ sudo apt-get install git

Fedora, CentOS or RHEL

$ sudo yum install git or $ Sudo dnf install git

Arch Linux

$ sudo pacman -S git

OpenSUSE

$ sudo zypper install git

Gentoo< Br>

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

Installing Git from source

If for some reason you want to install Git from source, follow the instructions below operating.

Installing dependencies

Before building Git, install its dependencies.

Debian, Ubuntu or Linux Mint

$ sudo apt-get install libcurl4-gnutls-dev libexpat1-dev gettext libz-dev libssl-dev asciidoc xmlto docbook2x

Fedora, CentOS or RHEL

$ sudo yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel asciidoc xmlto docbook2x

Compile Git from source code

From https: //github.com/git/git/releases Download the latest version of Git. Then build and install under /usr.

Note that if you plan to install it in another directory (for example: /opt), then replace the configuration command with “--prefix=/usr” with a different path.

$ cd git-x.x.x

$ make configure

$ . /configure --prefix=/usr

$ make all doc info

$ sudo make install install-doc install-html install-info

The above is how Linux installs Git The tutorial, as long as you learned to install Git operations, then Linux installation Git is still very fast.

Copyright © Windows knowledge All Rights Reserved