Getting started with Linux: Install Git on Linux

Source: Internet
Author: User
Tags arch linux linux mint

Getting started with Linux: Install Git on Linux

Problem: I tried to clone a project from a Git public repository, but the error message "git: command not found" appeared ". How can I install Git on a certain Linux release?

Git is a popular open-source version control system (VCS) that was initially developed for the Linux environment. Unlike version control systems such as CVS or SVN, Git version control is regarded as "distributed". In a sense, git's local working directory can be used as a fully functional repository with complete history and version tracking capabilities. Under this working model, collaborators submit the content to their local warehouse (Instead, the content is always submitted to the core warehouse). If necessary, then, we can selectively push data to the core repository. This provides the scalability and redundancy required for the version management system of Git.

 

Use the Package Manager to install Git

Git has been supported by all mainstream Linux distributions. Therefore, the simplest way to install it is to use the package manager of each Linux release.

Debian, Ubuntu, or Linux Mint

  1. $ sudo apt-get install git

Fedora, CentOS or RHEL

  1. $ sudo yum install git
  2. Or
  3. $ sudo dnf install git

Arch Linux

  1. $ sudo pacman -S git

OpenSUSE

  1. $ sudo zypper install git

Gentoo

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

 

Install Git from source code

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

Install dependency packages

Install the dependent package before building Git.

Debian, Ubuntu or Linux Mint

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

Fedora, CentOS or RHEL

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

 

Compile Git from source code

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

Note: If you want to install it in another directory (for example,/opt), replace the "-- prefix =/usr" configuration command with other paths.

  1. $ cd git-x.x.x
  2. $ make configure
  3. $ ./configure --prefix=/usr
  4. $ make all doc info
  5. $ sudo make install install-doc install-html install-info

GitHub Tutorials:

GitHub tutorials

Git tag management details

Git branch management

Git remote repository details

Git local Repository (Repository) Details

Git server setup and Client installation

Git Overview

Share practical GitHub tutorials

How to Build and use Git servers in Ubuntu

Git details: click here
Git: click here

Via: How to install git on Linux

Author: Dan Nanni Translator: mr-ping Proofreader: wxy

This article was originally translated by LCTT and launched with the Linux honor in China

This article permanently updates the link address:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.