git

Distributed version control system for tracking and managing code changes.

medium risk

interactive breakdown — edit the command and press Explain
$ 
⚠ Risks & cautions
Safer / dry-run alternatives
git push --force-with-leaseForce push that refuses to overwrite commits you have not seen.
What it does

git tracks file changes through commits and supports branching and merging. The working directory, staging area (index), and repository are distinct zones. Remote operations interact with upstream repositories.

Examples
git log --oneline --graph --all --decorateVisualize full branch history as a compact decorated graph · explain & risk-check →
git stash push -m 'WIP: feature-x' && git checkout mainStash current work and switch to main · explain & risk-check →
git diff HEAD~3 -- src/api/Show changes in src/api/ over the last 3 commits · explain & risk-check →
Pro tip

Use `git reflog` to recover lost commits after a bad reset or rebase — git keeps unreachable commits for ~90 days.

Related
gh
Open the full explainer →More in Git

Reference text is hand-written and may be incomplete — check man git for your version. Test destructive commands on a non-production system first.