How to install git on ubuntu

Max Zhang
4 min readApr 1, 2024

Introduction

Version control systems are increasingly indispensable in modern software development as versioning allows you to keep track of your software at the source level. You can track changes, revert to previous stages, and branch to create alternate versions of files and directories.

One of the most popular version control systems currently available is Git. Many projects’ files are maintained in a Git repository, and sites like GitHub, GitLab, and Bitbucket help to facilitate software development, project sharing, and collaboration.

In this guide, you will install and configure Git on an Ubuntu 18.04 server. This guide will cover how to install the software two different ways: via the built-in package manager, and via source. Each of these approaches come with their own benefits depending on your specific needs.

Prerequisites

In order to complete this tutorial, you should have a non-root user with sudo privileges on an Ubuntu 18.04 server.

With your server and user set up, you are ready to begin.

Installing Git with Default Packages

Ubuntu’s default repositories provide you with a fast method to install Git. Note that the version you install via these repositories may be older than the newest version currently available.

First, use the apt package management tools to update your local package index:

--

--

Max Zhang

Sincerely thanks for reading! If you like, you can add it to read list and you can tell me which topic article your want to read, I'll write it and share.