How to Install and Configure Git in Ubuntu

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:

Installation

Procedure 1:

$ 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.

Procedure 2:

$ sudo apt install git

This downloads and installs git on your system.

Procedure 3:

$ git --version

Check what version of git has been installed in your system.

Configuration

We will use the terminal to configure git. You will need to provide your username and email address.

Procedure 1:

$ git config --global user.username "<put here your username>"

This will set your global username

Procedure 2:

$ git config --global user.email "<put here your email@example.com>"

Procedure 3:

$ 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.


0 Comments

Feel free to post your comment in your language