{"id":8180,"date":"2025-03-30T17:36:52","date_gmt":"2025-03-30T12:06:52","guid":{"rendered":"https:\/\/www.veeble.com\/kb\/?p=8180"},"modified":"2025-04-25T14:54:08","modified_gmt":"2025-04-25T09:24:08","slug":"how-to-setup-git-on-ubuntu-easily","status":"publish","type":"post","link":"https:\/\/www.veeble.com\/kb\/how-to-setup-git-on-ubuntu-easily\/","title":{"rendered":"How to setup Git on Ubuntu easily."},"content":{"rendered":"\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/03\/image-5.jpg\"><img fetchpriority=\"high\" decoding=\"async\" width=\"713\" height=\"637\" src=\"https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/03\/image-5.jpg\" alt=\"How to setup Git on Ubuntu easily.\n\" class=\"wp-image-8399\" srcset=\"https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/03\/image-5.jpg 713w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/03\/image-5-300x268.jpg 300w\" sizes=\"(max-width: 713px) 100vw, 713px\" \/><\/a><\/figure>\n\n\n\n<p><a href=\"https:\/\/git-scm.com\/downloads\" target=\"_blank\" rel=\"noopener\">Git<\/a> is a powerful, open-source version control system that allows developers to track<br>changes in their codebase, collaborate with others, and manage their projects efficiently.<br>Setting up Git on <a href=\"https:\/\/ubuntu.com\/download\" target=\"_blank\" rel=\"noopener\">Ubuntu<\/a> is a straightforward process, whether you&#8217;re installing the<br>default version or a specific release. In this guide, we will walk you through the steps to<br>install Git on your Ubuntu VPS. If you&#8217;re looking for affordable and reliable VPS options, consider <a href=\"https:\/\/www.veeble.com\/in\/vps-hosting\/\">Veeble&#8217;s VPS services<\/a>, which guarantee 99% uptime.<\/p>\n\n\n\n<p><strong>Step 1: Connect to Your Ubuntu Server via SSH<\/strong><br><br><strong>Step 2: Update Your System<\/strong><br>Once you are logged in, run the following commands to update and upgrade your system:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt update -y &amp;&amp; sudo apt upgrade -y<\/code><\/pre>\n\n\n\n<p><br><strong>Step 3: There are two main methods to set up Git on Ubuntu : <\/strong><\/p>\n\n\n\n<p>Installing the default version or Installing a specific version.<\/p>\n\n\n\n<p><br><strong>Method 1: Install the Default Version of Git.<\/strong><\/p>\n\n\n\n<p><br>Git is often pre-installed on Ubuntu systems, so before installing it, you should check if it\u2019s<br>already on your server. To check, run:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git --version<\/code><\/pre>\n\n\n\n<p><br>If Git is installed, you\u2019ll see the installed version number in the output.<br>If Git is not installed, you can easily install it from Ubuntu\u2019s official repositories with the<br>following command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install git<\/code><\/pre>\n\n\n\n<p><br>After installation, verify Git is installed by running:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git --version<\/code><\/pre>\n\n\n\n<p><br><strong>Method 2: Install a Specific Version of Git<\/strong><\/p>\n\n\n\n<p><strong><br><\/strong>If you need a specific version of Git, follow these steps:<\/p>\n\n\n\n<p><br>\u25cf <strong>Install Required Libraries<\/strong>: To build Git from source, you&#8217;ll need to install some<br><a href=\"https:\/\/github.com\/topics\/library\" target=\"_blank\" rel=\"noopener\">essential libraries<\/a>:<br><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code>sudo apt install build-essential libz-dev libssl-dev libcurl4-gnutls-dev libexpat1-dev gettext cmake gcc -y<\/code><\/code><\/pre>\n\n\n\n<p><br>\u25cf <strong>Download the Git Source Code<\/strong>: Next, download the source code for the version of<br>Git you wish to install(replace the version number with your desired version):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>curl -L https:\/\/mirrors.edge.kernel.org\/pub\/software\/scm\/git\/git-2.45.2.tar.gz -o git-2.45.2.tar.gz<\/code><\/pre>\n\n\n\n<p><br>\u25cf <strong>Extract the Downloaded File<\/strong>: Extract the contents of the tarball:<br><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tar -zxf git-2.45.2.tar.gz<\/code><\/pre>\n\n\n\n<p><br>\u25cf <strong>Compile and Install Git<\/strong>: Navigate to the extracted folder and compile Git:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd git-2.45.2\/\nmake prefix=\/usr\/local all\nsudo make prefix=\/usr\/local install<\/code><\/pre>\n\n\n\n<p><br>\u25cf <strong>Verify the Installation<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git --version<\/code><\/pre>\n\n\n\n<div class=\"wp-block-uagb-advanced-heading uagb-block-c1eb7c4f\"><h2 class=\"uagb-heading-text\">Conclusion<\/h2><\/div>\n\n\n\n<p><a href=\"https:\/\/git-scm.com\/downloads\" target=\"_blank\" rel=\"noopener\">Git<\/a> on Ubuntu offers easy installation, secure updates, and seamless integration with<br>IDEs like VS Code and IntelliJ. The command line provides flexibility, while customization<br>options allow automation to boost productivity. With optimized performance and a secure<br>version control system, it&#8217;s ideal for collaborative development.<\/p>\n\n\n\n<div style=\"height:25px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"wp-block-uagb-call-to-action uagb-block-ff879c66 wp-block-button\"><div class=\"uagb-cta__wrap\"><h3 class=\"uagb-cta__title\">Scale Your Python App<\/h3><p class=\"uagb-cta__desc\">Grow effortlessly with Veeble. Get optimized speed, auto-scaling, support for major frameworks &amp; DBs, plus 99.9% uptime. Choose ScaleUP or ProMaster plans.<\/p><\/div><div class=\"uagb-cta__buttons\"><a href=\"https:\/\/www.veeble.com\/in\/python-hosting\/\" class=\"uagb-cta__button-link-wrapper wp-block-button__link\" target=\"_blank\" rel=\"noopener noreferrer\">Start Hosting Now<svg xmlns=\"https:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\"><path d=\"M504.3 273.6l-112.1 104c-6.992 6.484-17.18 8.218-25.94 4.406c-8.758-3.812-14.42-12.45-14.42-21.1L351.9 288H32C14.33 288 .0002 273.7 .0002 255.1S14.33 224 32 224h319.9l0-72c0-9.547 5.66-18.19 14.42-22c8.754-3.809 18.95-2.075 25.94 4.41l112.1 104C514.6 247.9 514.6 264.1 504.3 273.6z\"><\/path><\/svg><\/a><\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Git is a powerful, open-source version control system that allows developers to trackchanges in their codebase, collaborate with others, and manage their projects efficiently.Setting [&hellip;]<\/p>\n","protected":false},"author":14,"featured_media":8399,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[15,1],"tags":[37],"class_list":["post-8180","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-developers-stuff","category-uncategorized","tag-installation"],"uagb_featured_image_src":{"full":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/03\/image-5.jpg",713,637,false],"thumbnail":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/03\/image-5-150x150.jpg",150,150,true],"medium":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/03\/image-5-300x268.jpg",300,268,true],"medium_large":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/03\/image-5.jpg",713,637,false],"large":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/03\/image-5.jpg",713,637,false],"1536x1536":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/03\/image-5.jpg",713,637,false],"2048x2048":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/03\/image-5.jpg",713,637,false]},"uagb_author_info":{"display_name":"Jeevan Kurian","author_link":"https:\/\/www.veeble.com\/kb\/author\/jeevan\/"},"uagb_comment_info":0,"uagb_excerpt":"Git is a powerful, open-source version control system that allows developers to trackchanges in their codebase, collaborate with others, and manage their projects efficiently.Setting [&hellip;]","_links":{"self":[{"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/posts\/8180","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/users\/14"}],"replies":[{"embeddable":true,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/comments?post=8180"}],"version-history":[{"count":6,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/posts\/8180\/revisions"}],"predecessor-version":[{"id":8738,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/posts\/8180\/revisions\/8738"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/media\/8399"}],"wp:attachment":[{"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/media?parent=8180"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/categories?post=8180"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/tags?post=8180"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}