{"id":30709,"date":"2022-07-23T12:30:20","date_gmt":"2022-07-23T12:30:20","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=30709"},"modified":"2022-12-23T05:52:16","modified_gmt":"2022-12-23T05:52:16","slug":"git-install-and-upgrade-from-source-in-rhel-centos","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/git-install-and-upgrade-from-source-in-rhel-centos\/","title":{"rendered":"Git Install and Upgrade from Source in RHEL \/ CENTOS"},"content":{"rendered":"\n<p>This tutorial will help you to install git 2.9.5 on CentOS\/RHEL 7\/6\/5 and Fedora 26\/25\/24 operating systems using the source code.<\/p>\n\n\n\n<p><strong>Step 1 \u2013 Install Required Packages<\/strong><\/p>\n\n\n\n<p>Before installing Git from source code, make sure you have already installed required packages on your system. If not use the following command to install required packages. <\/p>\n\n\n\n<p># yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel <\/p>\n\n\n\n<p># yum install gcc perl-ExtUtils-MakeMaker<\/p>\n\n\n\n<p><strong>Step 2 \u2013 Download and Install Git 2.9.5(One of the latest)<\/strong><\/p>\n\n\n\n<p>Download latest Git source code from kernel git or simply use following command to download Git 2.14.0. <\/p>\n\n\n\n<p># cd \/opt <\/p>\n\n\n\n<p># yum install wget <\/p>\n\n\n\n<p># wget https:\/\/www.kernel.org\/pub\/software\/scm\/git\/git-2.9.5.tar.gz <\/p>\n\n\n\n<p># tar xzf git-2.9.5.tar.gz <\/p>\n\n\n\n<p>After downloading and extracting Git source code, Use the following command to compile the source code. <\/p>\n\n\n\n<p># cd git-2.9.5 <\/p>\n\n\n\n<p># make prefix=\/usr\/local\/git all <\/p>\n\n\n\n<p># make prefix=\/usr\/local\/git install<\/p>\n\n\n\n<p><br><strong>Step 3 \u2013 Setup Environment<\/strong><\/p>\n\n\n\n<p>After installation of git client. Now you must need to set binary in the system environment. So edit \/etc\/bashrc file and add below content to it <\/p>\n\n\n\n<p>export PATH=\/usr\/local\/git\/bin:$PATH <\/p>\n\n\n\n<p>Now execute below command to reload configuration in current environment. <\/p>\n\n\n\n<p># source \/etc\/bashrc <\/p>\n\n\n\n<p>After completing above steps. Let\u2019s use following command to check current git version. <\/p>\n\n\n\n<p># git &#8211;version git version 2.9.5<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This tutorial will help you to install git 2.9.5 on CentOS\/RHEL 7\/6\/5 and Fedora 26\/25\/24 operating systems using the source code. Step 1 \u2013 Install Required Packages Before installing Git&#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[2],"tags":[],"class_list":["post-30709","post","type-post","status-publish","format-standard","hentry","category-uncategorised"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/30709","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=30709"}],"version-history":[{"count":1,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/30709\/revisions"}],"predecessor-version":[{"id":30710,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/30709\/revisions\/30710"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=30709"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=30709"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=30709"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}