Home / Linux / How to Install Git and Clone Repositories

How to Install Git and Clone Repositories

Install Git on a Linux VPS, configure basic identity, clone a repository, and verify files step by step.

Views: 19 Unique: 16 Updated: 2026-03-18

What this is

Git is a version control system used to manage source code. This guide shows how to install Git and clone repositories on a VPS.

What it is for

  • Deploy apps from GitHub/GitLab
  • Track changes and collaborate

Prerequisites

  • SSH + sudo
  • Repository URL (HTTPS or SSH)

Step-by-step

Step 1) Install Git

Ubuntu/Debian:

sudo apt update
sudo apt install -y git

RHEL-based:

sudo dnf install -y git

Step 2) Verify version

git --version

Step 3) Configure your name/email (recommended)

git config --global user.name "Your Name"
git config --global user.email "you@example.com"

Step 4) Clone a repository (HTTPS)

cd ~
git clone https://github.com/OWNER/REPO.git

Step 5) Verify files

cd REPO
ls -la

Warnings & notes

  • For private repos, use SSH keys or a deploy token.

Conclusion

Git is installed and you can clone repositories. Next steps: pull updates and deploy safely.

Back to category