{"id":5244,"date":"2020-10-16T19:34:48","date_gmt":"2020-10-16T23:34:48","guid":{"rendered":"https:\/\/www.globo.tech\/learning-center\/?p=5244"},"modified":"2020-10-16T19:53:44","modified_gmt":"2020-10-16T23:53:44","slug":"how-to-install-git-on-centos-7","status":"publish","type":"post","link":"https:\/\/www.globo.tech\/learning-center\/how-to-install-git-on-centos-7\/","title":{"rendered":"How to install Git on CentOS 7"},"content":{"rendered":"\n<figure class=\"wp-block-image size-full is-style-default\"><img loading=\"lazy\" decoding=\"async\" width=\"1200\" height=\"628\" src=\"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2020\/10\/install-git-on-centos7.jpg\" alt=\"How to install GIT on CentOS 7\" class=\"wp-image-5245\" srcset=\"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2020\/10\/install-git-on-centos7.jpg 1200w, https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2020\/10\/install-git-on-centos7-573x300.jpg 573w, https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2020\/10\/install-git-on-centos7-768x402.jpg 768w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/figure>\n\n\n\n<p>Git is a distributed version control system created by <a href=\"https:\/\/en.wikipedia.org\/wiki\/Linus_Torvalds\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Linus Torvalds<\/a> to develop Linux Kernel. A version control system allows us to save snapshots of a software project we are working on. Learn how to Install Git On CentOS 7.<\/p>\n\n\n\n<p>The purpose of Git is to manage a project and set of files as they change over time. Git stores this information in a repository. A repository contains all of the project files and the entire revision history. Git allows multiple developers to work on the same project and allows you to keep track of changes, revert to the previous version and collaborate with other developers.<\/p>\n\n\n\n<p><strong>Prerequisite<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>A <a rel=\"noreferrer noopener\" href=\"https:\/\/www.globo.tech\/dedicated-server-hosting\" target=\"_blank\">server <\/a>running CentOS 7<\/li><li>ROOT access to the server<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Install Git with Yum<\/h2>\n\n\n\n<p>The simple and easiest way to install Git is to use CentOS\u2019s yum repository. By default, the latest version of the Git is not available in the CentOS 7 repository. So you will need to add the Wandisco repository in your system.<\/p>\n\n\n\n<p>You can create it with the following command:<\/p>\n\n\n\n<p><code>nano \/etc\/yum.repos.d\/git.repo<\/code><\/p>\n\n\n\n<p>Add the following lines:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"> [wandisco-git]\n name=Wandisco GIT Repository\n baseurl=http:\/\/opensource.wandisco.com\/centos\/7\/git\/$basearch\/\n enabled=1\n gpgcheck=1\n gpgkey=http:\/\/opensource.wandisco.com\/RPM-GPG-KEY-WANdisco<\/pre>\n\n\n\n<p>Save and close the file when you are finished. Then, import the GPG keys with the following command:<\/p>\n\n\n\n<p><code>rpm --import http:\/\/opensource.wandisco.com\/RPM-GPG-KEY-WANdisco<\/code><\/p>\n\n\n\n<p>Once the repository has been created, install the Git using the following command:<\/p>\n\n\n\n<p><code>yum install git -y<\/code><\/p>\n\n\n\n<p>Once the Git has been installed, verify the installed version of the Git using the following command:<\/p>\n\n\n\n<p><code>git --version<\/code><\/p>\n\n\n\n<p>You should see the following output:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">git version 2.22.0<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><br>Install Git from Source on Centos 7<\/h2>\n\n\n\n<p>If you want to install the specific version of Git, it is a good idea to compile it from the source.<\/p>\n\n\n\n<p>In order to compile the Git from the source, you will need to install the required dependencies in your system.<\/p>\n\n\n\n<p>You can install all the required dependencies using the following command:<\/p>\n\n\n\n<p><code>yum groupinstall \"Development Tools<br>\nyum install gettext-devel openssl-devel perl-devel perl-CPAN zlib-devel<\/code><\/p>\n\n\n\n<p>Once all the packages are installed, go to the Git release page. https:\/\/github.com\/git\/git\/releases and download your desired Git version:<\/p>\n\n\n\n<p><code>wget https:\/\/github.com\/git\/git\/archive\/v2.26.2.tar.gz<\/code><\/p>\n\n\n\n<p>Once the download is completed, extract the downloaded file with the following command:<\/p>\n\n\n\n<p><code>tar -xvzf v2.26.2.tar.gz<\/code><\/p>\n\n\n\n<p>Next, change the directory to the extracted directory and create a Makefile and configure Git with the following command:<\/p>\n\n\n\n<p><code>cd git-2.26.2<br>\nmake configure<br>\n.\/configure --prefix=\/usr\/local<\/code><\/p>\n\n\n\n<p>Next, run the following command to compile the Git and install it to your server with the following command:<\/p>\n\n\n\n<p><code>make install<\/code><\/p>\n\n\n\n<p>Once the Git has been installed, verify the installed version of the Git using the following command:<\/p>\n\n\n\n<p><code>git --version<\/code><\/p>\n\n\n\n<p>You should see the following output:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"> git version 2.22.0<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><br>Configure Git<\/h2>\n\n\n\n<p>At this point, Git is installed in your system. Next, you will need to set up your personal information that will be used when you commit changes to your code.<\/p>\n\n\n\n<p>You can set Git username and email address with the following command:<\/p>\n\n\n\n<p><code>git config --global user.name \"GloboTech Communications\"<br>\ngit config --global user.email \"sysadmin@globo.tech\"<\/code><\/p>\n\n\n\n<p>You can verify the configuration using the following command:<\/p>\n\n\n\n<p><code>git config --list<\/code><\/p>\n\n\n\n<p>You should see the following output:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"> user.name=GloboTech Communications\n user.email=sysadmin@globo.tech<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><br>Conclusion<\/h2>\n\n\n\n<p>In this guide, you learned how to install and configure Git on CentOS 7. For more information about Git, visit the Git documentation. <a href=\"https:\/\/git-scm.com\/book\/en\/v2\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/git-scm.com\/book\/en\/v2<\/a><\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>Git is a distributed version control system created by Linux Torvalds to develop Linux Kernel. Guide on how to Install Git On CentOS 7<!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":3,"featured_media":5245,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-5244","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to install Git on CentOS 7 - Globo.Tech<\/title>\n<meta name=\"description\" content=\"Git is a distributed version control system created by Linux Torvalds to develop Linux Kernel. Guide on how to Install Git On CentOS 7\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.globo.tech\/learning-center\/how-to-install-git-on-centos-7\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to install Git on CentOS 7 - Globo.Tech\" \/>\n<meta property=\"og:description\" content=\"Git is a distributed version control system created by Linux Torvalds to develop Linux Kernel. Guide on how to Install Git On CentOS 7\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.globo.tech\/learning-center\/how-to-install-git-on-centos-7\/\" \/>\n<meta property=\"og:site_name\" content=\"Globo.Tech\" \/>\n<meta property=\"article:published_time\" content=\"2020-10-16T23:34:48+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-10-16T23:53:44+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2020\/10\/install-git-on-centos7.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"GloboTech Communications\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"GloboTech Communications\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.globo.tech\/learning-center\/how-to-install-git-on-centos-7\/\",\"url\":\"https:\/\/www.globo.tech\/learning-center\/how-to-install-git-on-centos-7\/\",\"name\":\"How to install Git on CentOS 7 - Globo.Tech\",\"isPartOf\":{\"@id\":\"https:\/\/www.globo.tech\/learning-center\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.globo.tech\/learning-center\/how-to-install-git-on-centos-7\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.globo.tech\/learning-center\/how-to-install-git-on-centos-7\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2020\/10\/install-git-on-centos7.jpg\",\"datePublished\":\"2020-10-16T23:34:48+00:00\",\"dateModified\":\"2020-10-16T23:53:44+00:00\",\"author\":{\"@id\":\"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87\"},\"description\":\"Git is a distributed version control system created by Linux Torvalds to develop Linux Kernel. Guide on how to Install Git On CentOS 7\",\"breadcrumb\":{\"@id\":\"https:\/\/www.globo.tech\/learning-center\/how-to-install-git-on-centos-7\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.globo.tech\/learning-center\/how-to-install-git-on-centos-7\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.globo.tech\/learning-center\/how-to-install-git-on-centos-7\/#primaryimage\",\"url\":\"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2020\/10\/install-git-on-centos7.jpg\",\"contentUrl\":\"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2020\/10\/install-git-on-centos7.jpg\",\"width\":1200,\"height\":628,\"caption\":\"How to install GIT on CentOS 7\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.globo.tech\/learning-center\/how-to-install-git-on-centos-7\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.globo.tech\/learning-center\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to install Git on CentOS 7\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.globo.tech\/learning-center\/#website\",\"url\":\"https:\/\/www.globo.tech\/learning-center\/\",\"name\":\"Globo.Tech\",\"description\":\"Welcome to the Official Globo.Tech Learning Center\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.globo.tech\/learning-center\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87\",\"name\":\"GloboTech Communications\",\"sameAs\":[\"http:\/\/www.gtcomm.net\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to install Git on CentOS 7 - Globo.Tech","description":"Git is a distributed version control system created by Linux Torvalds to develop Linux Kernel. Guide on how to Install Git On CentOS 7","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.globo.tech\/learning-center\/how-to-install-git-on-centos-7\/","og_locale":"en_US","og_type":"article","og_title":"How to install Git on CentOS 7 - Globo.Tech","og_description":"Git is a distributed version control system created by Linux Torvalds to develop Linux Kernel. Guide on how to Install Git On CentOS 7","og_url":"https:\/\/www.globo.tech\/learning-center\/how-to-install-git-on-centos-7\/","og_site_name":"Globo.Tech","article_published_time":"2020-10-16T23:34:48+00:00","article_modified_time":"2020-10-16T23:53:44+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2020\/10\/install-git-on-centos7.jpg","type":"image\/jpeg"}],"author":"GloboTech Communications","twitter_misc":{"Written by":"GloboTech Communications","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.globo.tech\/learning-center\/how-to-install-git-on-centos-7\/","url":"https:\/\/www.globo.tech\/learning-center\/how-to-install-git-on-centos-7\/","name":"How to install Git on CentOS 7 - Globo.Tech","isPartOf":{"@id":"https:\/\/www.globo.tech\/learning-center\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.globo.tech\/learning-center\/how-to-install-git-on-centos-7\/#primaryimage"},"image":{"@id":"https:\/\/www.globo.tech\/learning-center\/how-to-install-git-on-centos-7\/#primaryimage"},"thumbnailUrl":"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2020\/10\/install-git-on-centos7.jpg","datePublished":"2020-10-16T23:34:48+00:00","dateModified":"2020-10-16T23:53:44+00:00","author":{"@id":"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87"},"description":"Git is a distributed version control system created by Linux Torvalds to develop Linux Kernel. Guide on how to Install Git On CentOS 7","breadcrumb":{"@id":"https:\/\/www.globo.tech\/learning-center\/how-to-install-git-on-centos-7\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.globo.tech\/learning-center\/how-to-install-git-on-centos-7\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.globo.tech\/learning-center\/how-to-install-git-on-centos-7\/#primaryimage","url":"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2020\/10\/install-git-on-centos7.jpg","contentUrl":"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2020\/10\/install-git-on-centos7.jpg","width":1200,"height":628,"caption":"How to install GIT on CentOS 7"},{"@type":"BreadcrumbList","@id":"https:\/\/www.globo.tech\/learning-center\/how-to-install-git-on-centos-7\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.globo.tech\/learning-center\/"},{"@type":"ListItem","position":2,"name":"How to install Git on CentOS 7"}]},{"@type":"WebSite","@id":"https:\/\/www.globo.tech\/learning-center\/#website","url":"https:\/\/www.globo.tech\/learning-center\/","name":"Globo.Tech","description":"Welcome to the Official Globo.Tech Learning Center","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.globo.tech\/learning-center\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87","name":"GloboTech Communications","sameAs":["http:\/\/www.gtcomm.net"]}]}},"_links":{"self":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts\/5244","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/comments?post=5244"}],"version-history":[{"count":7,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts\/5244\/revisions"}],"predecessor-version":[{"id":5261,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts\/5244\/revisions\/5261"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/media\/5245"}],"wp:attachment":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/media?parent=5244"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/categories?post=5244"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/tags?post=5244"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}