Git is likely already installed in your Ubuntu 20.04. You can confirm this is the case on your server with the following command:
$ git --version # OUTPUT git version 2.25.1
However, if you did not get output of a Git version number, you can install it with the Ubuntu default package manager APT.
Make sure your Ubuntu is up to date and patched.
$ sudo apt update $ sudo apt upgrade
Git is available within Ubuntu’s default software repositories, making it possible to install it using conventional package management tools. After confirming the installation, apt
will install MariaDB and all required dependencies.
$ sudo apt install git
Setting Up Git
After you are satisfied with your Git version, you should configure Git so that the generated commit messages you make will contain your correct information and support you as you build your software project.
Configuration can be achieved by using the git config
command. Specifically, we need to provide our name and email address because Git embeds this information into each commit we do.
$ git config --global user.name "Your Name" $ git config --global user.email "youremail@domain.com" $ git config --list
Have fun!