# How to install Git on Linux (Ubuntu)

> Learn how to install Git on Linux Ubuntu with sudo apt install git, verify it with git --version, and set up your name, email, and editor with git config.

Author: [Flavio Copes](https://flaviocopes.com/about/) | Published: 2024-08-21 | Topics: [Git](https://flaviocopes.com/tags/git/) | Canonical: https://flaviocopes.com/how-to-install-git-on-linux-ubuntu/

In this post I’m going to detail how to get [Git](https://flaviocopes.com/git/) up and running on Linux, in particular on Ubuntu.

First, open your terminal. We'll use the command line for this installation.

Step 1: Update your package list with the following command:

```bash
sudo apt update
```

You may need to enter your password. This is a standard security measure.

Step 2: Install Git using this command:

```bash
sudo apt install git
```

Ubuntu will now install Git for you.

To verify the installation, type:

```bash
git --version
```

This should display the installed Git version.

Next, set up your Git identity:

```bash
git config --global user.name "Your Name"
git config --global user.email "youremail@example.com"
```

Replace "Your Name" and "[youremail@example.com](mailto:youremail@example.com)" with your actual details.

If you use VS Code, you can set it as your default Git editor:

```bash
git config --global core.editor "code --wait"
```

This will open VS Code for commit messages and other Git operations that require text input.

With Git installed, you can start version controlling your projects. Navigate to your project folder and use `git init` to create a new repository.

While Git may seem complex initially, it becomes an invaluable tool with practice. It's widely used in software development for its powerful version control capabilities.

> Want to actually learn Git? Want to stop feeling frustrated with it? I created the [Git Masterclass](https://git.flaviocopes.com/) to solve this problem!
