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.