Core Installation
2. Git
Install and configure Git with SSH keys for GitHub. Complete setup for code versioning with AI assistants.
1 min read
Claude Code uses Git extensively: it reads history, makes commits, creates branches, and resolves conflicts.
Add the official Git PPA
sudo add-apt-repository ppa:git-core/ppa -yUpdate package index
sudo apt updateInstall updated Git
sudo apt install -y gitCheck version
git --version
# Expected: git version 2.47+ (Jan 2026)Minimal configuration
Set your name
git config --global user.name "Seu Nome"Set your email
git config --global user.email "[email protected]"Default branch
git config --global init.defaultBranch mainCheck configuration
Check name
git config --global user.nameCheck email
git config --global user.emailCheck default branch
git config --global init.defaultBranchUseful commands
View repository status
git statusCommit list (titles only)
git log --onelineFull commit list (with details)
git logRevert to the last commit (discard everything)
git reset --hard HEAD && git clean -fd
# Discards changes and removes untracked filesRevert to a specific commit
git reset --hard <hash-do-commit> && git clean -fd
# Replace <hash-do-commit> with the hash from git log