Are you a developer with a laptop that runs Ubuntu or Linux? If you are, then there's a chance you're going to need a DevOps tool called Git. This open-source source code management tool can be used to track changes you make to files, fulfill pull requests, and much more. Typically, Git will come pre-installed on Ubuntu and other Linux systems, but if you're having issues with it, you can also install it manually in a few simple steps with the terminal app. Here's what to do if you want Git on your favorite laptop or favorite desktop.
How to install Git on Ubuntu
To install Git on Ubuntu, you're going to need an administrative account, and access to the terminal. Once you pass those prerequisites, it'll be smooth sailing. Keep in mind that you'll have to press Enter after each command.
- Launch a terminal window by pressing Ctrl + Alt + T on your keyboard.
- Update your packages by tying sudo apt-get-update.
- Enter your password.
- Upgrade old packages with the following command: sudo apt upgrade.
- Tap Y on your keyboard.
- Enter your password.
- Install Git by typing sudo apt-get install git-all.
- Enter your password.
- Type Y and then press Enter to confirm the installation and the size.
You can confirm that Git has successfully been installed on your system by entering the command git version, which will list out any installed Git versions. By going this route, Git will be maintained by your package manager.
If you want, to install Git another way, you can install it from the source code. To do this, type the command sudo add-apt-repository ppa:git-core/ppa -y. Enter your password, then, type sudo apt update. You can then type sudo apt install git -y to finish the process. Going this second route puts you a bit more in control of Git since you'll be able to grab the latest up-to-date versions.
