Installing and Setting Up Git on Ubuntu (Beginner’s Guide)
Source: Dev.to
Introduction
When starting your journey in software development, one of the first tools you’ll encounter is Git. Git is a distributed version control system that helps developers track changes in their code, collaborate with others, and manage projects efficiently.
Most developers store their projects in repositories (commonly called repos) on platforms such as GitHub. Git allows you to interact with these repositories directly from your local machine — pushing changes, pulling updates, and managing versions of your code.
In this guide we’ll walk through how to install Git on Ubuntu and perform the basic configuration needed to get started.
Prerequisites
- A PC running Ubuntu (or another Debian‑based Linux distribution)
- A GitHub account – if you don’t have one, sign up at
Step 1: Update Your System Packages
Open a terminal (Ctrl + Alt + T) and run:
sudo apt update
Step 2: Install Git
sudo apt install git
Press Y when prompted to confirm the installation.
Step 3: Verify the Installation
git --version
You should see output similar to:
git version 2.x.x
Step 4: Configure Your Identity
Git uses a username and email address to identify who made each commit. These should match the credentials you use on GitHub.
git config --global user.name "your-github-username"
git config --global user.email "your-email@example.com"
Step 5: Confirm Your Settings
git config --list
The output should include both user.name and user.email, e.g.:
user.email=your-email@example.com
user.name=your-github-username
At this point Git is successfully installed and configured on your machine.
Next steps (covered in a future article)
- Generating an SSH key
- Adding it to GitHub
- Connecting securely without typing your password every time
Installing and configuring Git is an essential first step for any developer. With Git set up on your Ubuntu system, you’re ready to start managing projects, collaborating with others, and contributing to open‑source software.
Happy coding!