#!/usr/bin/env bash
# install-git.sh
# Git — Distributed version control for tracking and collaborating on source code.
# Target: Ubuntu / Debian. Safe to re-run.
# Source guide: devops-hub/tools/git.html

set -euo pipefail

if [[ $EUID -eq 0 ]]; then
  echo "Run this as a regular sudo-capable user, not root." >&2
  exit 1
fi

echo "==> Update package index"
sudo apt update

echo "==> Install Git"
sudo apt install -y git

echo "==> Set your identity"
git config --global user.name "Your Name"
git config --global user.email "you@example.com"

echo "==> Verify"
git --version

echo "==> Done. Git installation finished."
