Installing and Setting Up Git on Ubuntu (Beginner’s Guide)

Published: (January 14, 2026 at 04:11 PM EST)
2 min read
Source: Dev.to

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!

Back to Blog

Related posts

Read more »

Day 1 of Learning Linux & GitHub 🚀

markdown !Forem Logohttps://media2.dev.to/dynamic/image/width=65,height=,fit=scale-down,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2...

Getting started with gitlab

What is Git text Git is a distributed version control system used to track changes in source code during software development. It allows multiple developers to...

WEEK 1 ASSIGNMENT.

Git Git is a version control system used for code collaboration, tracking code changes and who made them. Common Git commands bash git --version Checks whether...