Git is one of the most popular version control systems currently available. It provides facility to track changes in source code for many open source and commercial projects. Version control systems help you share and collaborate on software development projects. In this tutorial explains how to install Git on Ubuntu 20.04 Focal Fossa.
Install Git on Ubuntu
Ubuntu includes Git package in default Ubuntu repositories. It’s very simple and straightforward to install Git using apt package manager on Ubuntu.
Step 1 – Update Default Packages
First, update your default packages. Make sure you are logged in as a root or user with sudo privileges.
sudo apt update
Step 2 – Install Git
Run the below command to install Git:
sudo apt install git
Step 3 – Verify Installation
Verify the installation by running the following command which will show the Git version:
git version 2.25.1
Currently, in Ubuntu repositories latest git version is
2.25.1. It may vary while you are installing.
Step 4 – Configure Git
At this point, you have Git installed and to prevent warnings, you should configure it by setting up email address and username:
git config --global user.name "Your Name"
git config --global user.email "firstname.lastname@example.org"
Don’t forget to replace with your real name and email address.
You can check entered details by typing:
git config --list
user.name=Your Name email@example.com
These settings are stored at
~/.gitconfig file and you can see content as below:
You can make other git configuration changes by using git config command or you can use text editor to make changes to
~/.gitconfig file manually.
In this guide, we show you how to install Git on Ubuntu 20.04 Focal Fossa. You can get more details about use of Git from Pro Git book.
Feel free to comment below, if any question or suggestion.