Git Cheat Sheet
Whether you are a developer, system administrator, DevOps engineer, or a tech lead — Git is a must-have skill. This free, self-paced course walks you through everything you need from your very first git init to advanced branch management and SSH workflows.
Each module links to a dedicated article with commands, examples, and real-world use cases. Follow them in order for a structured learning path, or jump to any topic you need.
Course Info
- Duration: Self-paced
- Level: Beginner → Intermediate
- Audience: Developers, DevOps, Leads
- Modules: 12
- Source Repository
Foundations
Understand what Git is, why it matters, and how to set it up.
Module 1 — Introduction to Git
Why Git exists, who should use it, and the questions every engineer asks when starting with version control.
- Git vs GitHub / GitLab / Bitbucket
- Contributors — not just developers
- Mono-repo vs Poly-repo
Module 2 — Git Init
Initialize a local repository and connect it to a remote server like GitHub, GitLab, or Bitbucket.
git init— start a new repository- Connect local repo to remote
- First push to origin
Daily Workflow
The commands you will use every single day.
Module 3 — Commit Files
Stage, commit, and push your changes. The bread and butter of every Git user.
git status,git addgit commit -mgit push
Module 4 — Common Commands
Frequently used commands: viewing history, diffs, stashing, and tagging.
git log,git diffgit stashgit tag
Module 5 — Git Basics for Developers
A quick-reference card of configure, clone, pull, push, and branch commands every developer needs.
git config— global & repogit clone,git pull- Checkout & switch branches
Branching & Merging
Work with multiple features and contributors without chaos.
Module 6 — Create Branch
Create feature, develop, and hotfix branches following naming conventions.
git checkout -b- Branch naming conventions
- Push new branch to remote
Module 7 — Branch Management
List, rename, delete, and organize branches for single and multi-branch workflows.
- Single vs multi-branch strategy
- Delete local & remote branches
- Prune stale branches
Module 8 — Git Merge
Merge feature branches, resolve conflicts, and keep a clean commit history.
git mergeworkflow- Conflict resolution
- Fast-forward vs recursive merge
Undo & Fix Mistakes
Everyone makes mistakes. Git makes it safe to recover.
Module 9 — Reset Commits
Remove the last commit, revert to a specific commit, or clean up your history before a pull request.
git reset --soft/--hard- Remove last N commits
- Force push after reset
SSH & Remote Configuration
Secure your workflow with SSH keys and manage remote URLs.
Module 10 — Push with SSH
Generate an SSH key, add it to GitHub, and push without entering your password every time.
ssh-keygen- Add key to GitHub / GitLab
- Test SSH connection
Module 11 — Switch Remote URL (HTTPS ↔ SSH)
Switch an existing repository between HTTPS and SSH remote URLs.
git remote set-url- Verify with
git remote -v - When to use HTTPS vs SSH
For Tech Leads & Managers
Commands and workflows for people who manage repositories and teams.
Module 12 — Git for Project Leads
Count branches, audit contributors, review PRs, and manage releases from the command line.
- Branch audit & cleanup
- Contributor statistics
- Release tagging strategy
Suggested Learning Path
| # | Module | Who Should Read |
|---|---|---|
| 1 | Introduction to Git | Everyone |
| 2 | Git Init | Everyone |
| 3 | Commit Files | Everyone |
| 4 | Common Commands | Everyone |
| 5 | Git Basics for Developers | Developers |
| 6 | Create Branch | Everyone |
| 7 | Branch Management | Everyone |
| 8 | Git Merge | Everyone |
| 9 | Reset Commits | Developers, DevOps |
| 10 | Push with SSH | Everyone |
| 11 | Switch Remote URL | Everyone |
| 12 | Git for Project Leads | Leads, Managers |