[2 min installs] Git on Ubuntu

Better Stack Team
Updated on August 30, 2022

Here is how to install git on your Ubuntu 20.04 system in under two minutes:

Step 1 - Update the package list on your system

The first step is to update the package list on your system before proceeding to actual installation:

sudo apt update -y
Copied!

apt update downloads the package lists from the repositories and updates them to get information on the newest versions of packages and their dependencies. It will do this for all repositories and PPAs.

Step 2 - Install git package

Now, install git package by running the following command:

sudo apt-get install git
Copied!

Step 3 - Verify installation and setup username

To verify the git installation, run the following command:

git --version
Copied!

This will print the git version.

Configure your git username and email using the following commands, replacing My Name name with your own. These details will be associated with any commits that you create:

git config --global user.name "My Name"
git config --global user.email "[email protected]"
Copied!
Check Uptime, Ping, Ports, SSL and more.
Get Slack, SMS and phone incident alerts.
Easy on-call duty scheduling.
Create free status page on your domain.
Got an article suggestion? Let us know
Next article
[2 min installs] Anaconda on Ubuntu
Licensed under CC-BY-NC-SA

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.