Installing and Configuring Git on Linux Mint
Javier Machin

Jan 14, 2022

Installing and Configuring Git on Linux Mint

A beginner-friendly guide to setting up Git and SSH on Linux Mint

engineeringtutorialversion control

Available for senior roles & selected contracts email me

Whether you're a seasoned developer or just starting out, Git is a tool you'll want set up. Here's how to install and configure it on Linux Mint.


Step 1: Update Your System

First, make sure your system is up to date. Open your terminal (find it in the menu or hit Ctrl+Alt+T) and run:

sudo apt update && sudo apt upgrade

This fetches the latest package info and upgrades your system. It can take a few minutes.


Step 2: Install Git

With the system up to date, install Git with:

sudo apt install git

Your system might ask for your password and confirmation. Type it in and hit 'Y' when prompted. Git is now installed.


Step 3: Configure Git

Git doesn't know who you are yet, so set your name and email:

git config --global user.name 'Your Name'
git config --global user.email 'youremail@example.com'

Replace 'Your Name' and 'youremail@example.com' with your actual name and email. This info gets attached to your commits, so make sure it's correct.


Step 4: Generate an SSH Key

To securely interact with GitHub, let's create an SSH key. Run the following command:

ssh-keygen -t ed25519 -C 'youremail@example.com'

When prompted, hit Enter to accept the default file location. For added security, you can set a passphrase, but it's optional. This will generate a new SSH key pair (a public and a private key).


Step 5: Add Your SSH Key to the SSH Agent

Now that you've got your SSH key, let's make sure your SSH agent is running and add your key to it:

eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519

These commands will start the SSH agent and add your new key to it.


Step 6: Install xclip (Optional)

To make copying your SSH key easier, you can install xclip. Run this command:

sudo apt install xclip

If you don't want to install xclip, you can manually copy the SSH key by displaying its contents.


Step 7: Copy Your SSH Key to GitHub

If you installed xclip, copy your public key to the clipboard with:

cat ~/.ssh/id_ed25519.pub | xclip -selection clipboard

If you didn't install xclip, you can display the SSH key and manually copy it:

cat ~/.ssh/id_ed25519.pub

Then, head over to GitHub, go to 'Settings' > 'SSH and GPG keys' > 'New SSH key', paste your key, give it a name, and hit 'Add SSH key'.


Step 8: Check Your Git Version

Just to make sure everything is rolling, let's check which version of Git we've got:

git --version

This should spit out something like 'git version 2.x.x'. If you see this, congratulations! You've successfully installed Git.


Step 9: Create Your First Repository (Optional)

To create your first Git repository, run these commands. They make a new directory, move into it, and initialize it as a Git repository:

mkdir my_first_repo
cd my_first_repo
git init

That's it. You've installed and configured Git on Linux Mint and set up SSH for GitHub. You're ready to clone, commit, push, and pull.


Git has a bit of a learning curve, but it doesn't take long before branching and merging feel routine.


Shipping a Public AI Service Without Going Broke

A case study on deploying a public, no-sign-up AI service and keeping it secure, well-behaved, and running at a fraction of a cent per story.

Jun 14, 2026Read more