The Ubuntu 20.04 default apt repositories contain git packages. You can install git packages directly from the default git repositories. But they may not have the latest version of the git client.
Git core team also maintains a PPA with latest git Debian packages. You can add this PPA to your system and install the latest git on your system.
This tutorial will help you to install Git on Ubuntu 20.04 LTS Linux system.
Install Git on Ubuntu 20.04
Use the following steps to install Git on the Ubuntu Linux system.
- Install the software-properties-common package on your system, which contains add-apt-repository command
sudo apt install software-properties-common -y
- Add the PPA to your system using the following command.
sudo add-apt-repository ppa:git-core/ppa
- Next, install git debian package on your system
sudo apt install git -y
That’s it, Git has been installed on your Ubuntu system.
Configuirng Git Client
Setup the Git user details on your machine, which is used as your identity by the Github or other repository providers.
To set up a username and email address system-wide, execute the following command. Make sure to change your name and email address with yours.
git config --gloabl user.name "Rahul Kumar"
git config --gloabl user.email "[email protected]"
To configure identity for a specific repository, remove --global
from the above command and run it from your repository directory.
Conclusion
This tutorial explained how to install the latest Git on Ubuntu 20.04 LTS Linux system via the command line.