How to install Git on Ubuntu 21.04

How to Install Git on Ubuntu 21.04

Introduction:

Git is a software for tracking changes and can also be used to store content.It is a prominent version control system and it aids in handling numerous codes by maintaining a history. It is free and open-source software that also possesses a remote repository. Its main goal is to include speed and data integrity.

Installation Procedure

Checking OS version

linuxhelp@linuxhelp:~$ lsb_release -a
No LSB modules are available…
Distributor ID:	Ubuntu
Description:	Ubuntu 21.04
Release:	21.04
Codename:	hirsute

Swithc to root user

linuxhelp@linuxhelp:~$ sudo -s
[sudo] password for linuxhelp: 

Changing directory

root@linuxhelp:/home/linuxhelp# cd /

Installing Git

root@linuxhelp:/# apt install git
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  git-man liberror-perl
Suggested packages:
  git-daemon-run | git-daemon-sysvinit git-doc git-el git-email git-gui gitk gitweb git-cvs git-mediawiki git-svn
The following NEW packages will be installed:
  git git-man liberror-perl
0 upgraded, 3 newly installed, 0 to remove and 257 not upgraded.
Need to get 4,415 kB of archives.
After this operation, 30.8 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://in.archive.ubuntu.com/ubuntu hirsute/main amd64 liberror-perl all 0.17029-1 [26.5 kB]
Get:2 http://in.archive.ubuntu.com/ubuntu hirsute/main amd64 git-man all 1:2.30.2-1ubuntu1 [931 kB]
Get:3 http://in.archive.ubuntu.com/ubuntu hirsute/main amd64 git amd64 1:2.30.2-1ubuntu1 [3,457 kB]

Checking the installed git version

root@linuxhelp:/# git --version
git version 2.30.2

Configure global user by using following command

root@linuxhelp:/# git config --global user.name "linuxhelp"

Configure global Mail by using following command

root@linuxhelp:/# git config --global user.email "user@linuxhelp.org"

Opening the git configuration file

root@linuxhelp:/# vi ~/.gitconfig

Listing the credentionals

root@linuxhelp:/# git config --list
user.name=linuxhelp
user.email=user@linuxhelp.org

By this the installation of Git on ubuntu 21.04 comes to end

FAQ
Q
What is git bash?
A
It is an application that is widely designed for Microsoft Windows that can also be used in Linux systems environments and is recognized for providing an emulation layer.
Q
What is a Git repository?
A
The main purpose of it is to track and save the changes that were made in history and all the actions performed by it is by using a version control system.
Q
What is the purpose of Git?
A
Git is a software that is widely used for coordinating work in order to develop source files that are usually done among programmers and it is mainly used to track changes in any set of files.
Q
What is the difference between Git and GitHub?
A
The Git is a version control system, whose main purpose is to maintain track of the source code history, whereas Github is a cloud-based hosting that aids in managing the Git repositories.
Q
What is GIT software?
A
It is an acronym for Global Information Tracker that is widely used in the version control system. It aids in tracking the prior changes that were made in files.