It is best to install git
from the Ubuntu Software repository. This tutorial is based on Ubuntu 20.04. Run the following commands in your terminal following the order below:
$ sudo apt update $ sudo apt upgrade
It is important to always update and upgrage your APT. Since your are running as root, you will be asked to enter your password. Do so and the installation will continue.
$ sudo apt install git
This downloads and installs git
on your system.
$ git --version
Check what version of git has been installed in your system.
We will use the terminal to configure git
. You will need to provide your username and email address.
$ git config --global user.username "<put here your username>"
This will set your global username
$ git config --global user.email "<put here your email@example.com>"
$ git config --list
This step confirms all the changes you just made in the git
configuration file. If at any point you want to edit your changes, run $ git config
Read more on git
in their documentation.