In this simple guide, we show you how to install Git on Ubuntu 20.04 with practical examples from default reps as well as the PPA sources.
Git is a distributed version control system for tracking changes in any files. It is a popular system among programmers to help in coordinating work through cooperation on source code throughout the software development process. This results in speed, data integrity, and support for distributed, non-linear workflows.
You can always install Git packages from the default apt repositories. This may be okay unless you want the latest version available.
Install Git on Ubuntu 20.04
Use the following steps to install Git on Ubuntu 20.04 or older versions.
- First, install software-properties-common package on your system if it is not yet installed.
$ sudo apt install software-properties-common -y
- Add the Git-core PPA to your system using the following command:
$ sudo add-apt-repository ppa:git-core/ppa
$ sudo apt update
- Next, install git package on your system using the following command:
$ sudo apt install git -y
Git has been installed on your Ubuntu system.
We will have to do some post install setup to get things running more efficiently.
We will set up the Git user details on your Ubuntu system that will be used as your identity by repository providers such as GitHub, GitLab, and others. We will be setting the name and email address. This can be done by running the two commands as shown below using your preferred name and email.
$ git config --gloabl user.name "Example User"
$ git config --gloabl user.email "[email protected]"