How to install and configure Git on Ubuntu 20.04

s2 0

Git is a widely used open source version control system for software development. It was originally developed by Linus Torvalds and is used, for example, to manage the source code of the Linux kernel. Any type of software project can be handled effectively with GIT, often in conjunction with the free GIT hosting service GitHub.

This article shows you how to install and configure Git on Ubuntu 20.04 from the command line.

Install Git on Ubuntu 20.04

In this guide, we will be installing GIT using the official Ubuntu packages. The installation steps are performed on the Linux command line, the terminal.

Step 01: update packages

First you need to open a terminal by using Ctrl + Alt + T Update keys from keyboard and then update the apt package lists.

Run the below mentioned command to update APT:

$ sudo apt update

Then enter your password as you can see in the screenshot below.

Run the below mentioned command to update apt:

$ sudo apt upgrade

Install pending package updates

Before the upgrade begins, the system will ask a question that you want to continue, then press “y” for “yes”.

Proceed with the upgrade

Step 2: install GIT

The Git utility is available in Ubuntu’s software sources, which APT can install. Git can be installed by simply entering the following command.advertising

$ sudo apt install git

Git wants the sudo rights to be installed, enter the password and then press “y” to continue the installation.

Install GIT

Step 3: check the installed GIT version

With Git installed, you can check the verification with the following command in the screenshot.

$ git --version

Check GIT version

Git. configure

Git can be configured through the terminal or command line window. It requires a username to act as a binding name and an email address.

Step 1: configure GIT

Use the following command to set a username and swap the contents in the “Mahwish Aslam” with your name.

$ git config –global user.name “Mahwish Aslam”

Define GIT users

Step 2:

Run this command to set an email address, swap the content within the “[email protected]“With your user email.

$ git config –global user.email [email protected]

Set GIT email

Step 3: check GIT settings

The following command lists the changes made to the Git configuration file as shown in the screenshot.

$ git config --list

Check GIT settings

Step 4 (optional): GIT configuration

If you want to edit the settings, you can always change them with the following command:

$ git config

Using GIT configuration

diploma

Git is very easy to install on Ubuntu 20.04, you only need four commands to install and configure it. All you need is an APT command to install the stable version from the Ubuntu repository.

How to install and configure Git on Ubuntu 20.04
Tags: