Cheatsheets

Git Cheatsheet

Use this Git cheatsheet when you need the right command quickly: status checks, staging, commits, branches, remotes, safe undo workflows and everyday version-control examples.

Quick reference

Everyday commands

Check statusgit status

See changed, staged and untracked files.

Stage filesgit add .

Stage all current changes.

Commitgit commit -m "Message"

Save staged changes with a short message.

View historygit log --oneline --graph

Compact branch history.

Branches and remotes

Create branchgit switch -c feature-name
Switch branchgit switch main
Pull latestgit pull
Push branchgit push -u origin feature-name

Undo safely

Unstage filegit restore --staged file.ts
Discard file changesgit restore file.ts
Amend commitgit commit --amend
Revert commitgit revert <commit>

Examples

CodeStart a feature branch
git switch main
git pull
git switch -c improve-header
CodeCommit a focused change
git status
git add src/components/Header.tsx
git commit -m "Improve header navigation"

Git FAQ

What is included in the Git cheatsheet?

Git Cheatsheet includes quick reference sections, practical examples, common mistakes, tips and links to related DevKitYard tools.

Is the Git cheatsheet interactive?

This cheatsheet is a static quick reference focused on concise commands, syntax and examples.

When should I use this Git reference?

Use it when you need to recall syntax, compare common patterns or avoid mistakes without opening a long tutorial.

What should I use after reading this cheatsheet?

Use related DevKitYard tools such as Gitignore Generator, Text Diff Checker when you need to format, validate, generate or inspect real output.