This open-source source code management tool allows you to track changes in files, manage pull requests, and more. While Git usually comes pre-installed on Ubuntu and other Linux systems, you can also install it manually if you’re experiencing issues. Here’s a step-by-step guide to installing Git on your laptop or desktop.
How to Install Git on Ubuntu
To install Git on Ubuntu, you’ll need an administrative account and access to the terminal. Once you meet these prerequisites, the installation process will be straightforward. Remember to press Enter after each command.
- Open a terminal window by pressing
Ctrl + Alt + T
on your keyboard. - Update your packages by typing:
sudo apt-get update
Enter your password when prompted. - Upgrade old packages with the command:
sudo apt upgrade
TypeY
when prompted and enter your password. - Install Git by typing:
sudo apt-get install git-all
Enter your password. - Type
Y
and press Enter to confirm the installation and the size.
To confirm that Git has been successfully installed on your system, enter the command:
git version
This will display the installed Git version. By installing Git this way, it will be maintained by your package manager.
If you prefer a different method, you can install Git from the source code. To do this, type:
sudo add-apt-repository ppa:git-core/ppa -y
Enter your password, then type:
sudo apt update
Finally, install Git with the command:
sudo apt install git -y
This method gives you more control over Git, allowing you to access the latest versions.