•  Home
  •  Dashboard
  •  Company
    • About Us
    • Blog
    • Careers
    • Contact Us
    • Data Centers
    • Looking Glass
    • Network
    • Reseller
  •  Hosting Services
    • Infrastructure
      • iColocation
    • Compute
      • cMetal
      • cVirtual
    • Storage
      • sObject
      • sBlock
    • Networking
      • nCDN
      • nIP Transit
      • nWavelength
    • Protection
      • pBackup
      • pDDoS
  •  Solutions
    • Ecommerce
    • Finance
    • Gaming
    • Hosting
    • Management
    • Security
    • System Integrator
  •  Support
    • Community
    • Knowledge Base
    • Open A Ticket
  •  USA & Canada: 800-933-1517
  •  International: 626-549-2801
  •  Email: sales@psychz.net
  • Services
    • new-colocation-header-img
      Infrastructure
      • iColocation
    • new-compute-header-img
      Compute
      • cMetal
      • cVirtual
    • new-storage-header-img
      Storage
      • sObject
      • sBlock
    • new-networking-header-img
      Networking
      • nCDN
      • nIP Transit
      • nWavelength
    • new-protection-header-img
      Protection
      • pBackup
      • pDDoS
  • Solutions
    • Ecommerce
    • Security
    • Gaming
    • Hosting
    • Management
    • Finance
    • System Integrator
  • Dashboard

How To Install Git On Centos 7

  • Home
  • Client
  • Knowledgebase
  • Linux
  • Centos 7
  • How To Install Git On Centos 7

Table Of Content

Related Articles

  • How to configure IP's On Centos 7?
  • Installing MariaDB on Centos 7
  • How to install the GCC compiler in CentOS 7?
  • How to Install SSL Certificate On Centos 7
  • Linux Command Line Tutorial For Git
  • Installation of Lamp Stack on CentOS 7
  • Yum Update Not Working on Centos 7
  • Views: (3434)
  • Votes: (0)
Was this article helpful?
VOTE

How To Install Git On Centos 7

Publisher: Psychz Networks,  February 06,2019

Git is a version control system which is designed to support software development projects. With the help of Git, you can keep track of software changes, create versions of files and directories. It is a very useful tool for the developers as it can make sure everyone is working on the same version of code, track changes and maintain progress. Developed on opensource technology, it is intended to run on Linux kernel.

Let us now install Git on our CentOS server.

This can be done in two ways. We will cover both the techniques in this guide.

Method 1: Using YUM Package manager

Using YUM package manager we will install Git from system repositories. We will first run system update with the latest version of packages using YUM command as shown below

# yum update

Once we are sure that the system is up to date, we will install Git by typing the following command:

# yum install git

Once the installation is complete you can check the Git version that is installed using the following command

# git --version

Method 2: Using the source

In this method, first, we need to install required software dependencies from the default repositories. Also, you would need the utilities that is required to build a binary from source. Use following command in the following order

# yum groupinstall "Development Tools"
# yum install gettext-devel openssl-devel perl-CPAN perl-devel zlib-devel

Once the dependencies are installed you need to download the latest version of Git from their official Git release page and grab the latest version

# wget https://github.com/git/git/archive/v2.20.1.tar.gz -O git.tar.gz

Once the download is complete, we can unpack the source archive using tar.

# tar -zxf git.tar.gz

z decompresses the archive (since all .gz files are compressed)
x extracts the individual files and folders from the archive
f tells tar that we are declaring a filename to work with

We'll need to move to that folder to begin configuring our build. You can use a wildcard (*) to save us some trouble in moving to that folder just like shown below.

# cd git-*

Now we begin with source build process with pre-build checks for software and hardware dependencies.

We can check this with the configure script that is generated by make configure. This script will also use a --prefix to declare /usr/local (the default program folder for Linux platforms) as the appropriate destination for the new binary, and will create a 'Makefile' to be used in the following step.

# make configure

# ./configure --prefix=/usr/local

With a Makefile in place, we can now execute make install (with sudo privileges) to compile the source code into a working program and install it to our server:

# make install

NOTE: Makefiles are scriptable configuration files that are processed by the make utility. Our Makefile will tell make how to compile a program and link it to our CentOS installation so that we can execute the program properly.

Git should now be built and installed on your CentOS 7 server. To double-check that it is working correctly, try running Git's built-in version check:

# git --version

Related Articles

  • How to configure IP's On Centos 7?
  • Installing MariaDB on Centos 7
  • How to install the GCC compiler in CentOS 7?
  • How to Install SSL Certificate On Centos 7
  • Linux Command Line Tutorial For Git
  • Installation of Lamp Stack on CentOS 7
  • Yum Update Not Working on Centos 7
  • Views: (3434)
  • Votes: (0)
Was this article helpful?
VOTE
Copyright © 2025 Psychz Networks,
A Profuse Solutions Inc Company
Hosting Services
Infrastructure
  • iColocation
Compute
  • cMetal
  • cVirtual
Storage
  • sObject
  • sBlock
Networking
  • nCDN
  • nIP Transit
  • nWavelength
Protection
  • pBackup
  • pDDoS
Company
  • About Us
  • Blog
  • Careers
  • Contact Us
  • Data Centers
  • Looking Glass
  • Network
  • Reseller
Policies
  • Acceptable Usage Policy
  • Privacy Policy
  • Service Level Agreement
  • Terms and Conditions
Support
  • Community
  • Knowledge Base
  • Open A Ticket
Get In Touch
  • Psychz Networks,
    A Profuse Solutions Company
    611 Wilshire Blvd #300
    Los Angeles,California 90017
    USA
  • US/Canada: 800-933-1517
  • International: 626-549-2801