LearnDevOpsHands-On Labs
All Tutorials
🔧
Essential · Beginner

Git & Version Control

Branching strategies, interactive rebasing, merge conflict resolution, git hooks, cherry-pick, and GitOps workflows.

17 Modules & Lessons
Estimated Time: ~6 Hours

Curriculum & Notes

Click any title or "See Notes" to read concepts

1Module 1: Git Core Fundamentals

6 lessons
Introduction to Git

Learn what Git is and why version control matters: distributed versus centralized systems, how Git stores history and the key terms to know first.

Installing Git

Install Git on macOS, Linux and Windows, then configure what matters: your identity, default branch, editor and .gitattributes for consistent line endings.

Git Basics

Learn the everyday Git loop with init, clone, status, add, commit, log and diff, understand the staging area and build checks to run before every commit.

Git Branching

Learn what a Git branch really is, git switch versus checkout, how HEAD and detached HEAD work, and how to delete, rename and name branches well.

Git Merging

Learn git merge: fast-forward versus three-way merges, resolving conflict markers step by step, --no-ff and squash merges, and aborting a bad merge.

Git Rebasing

Use git rebase for a linear history: basic and interactive rebase, squashing, recovering with --abort and reflog, force-with-lease, and when to merge instead.

2Module 2: Branching, Merging & Fast-Forward

5 lessons
Git Remote

Work with Git remotes confidently: fetch versus pull, fixing a rejected push without force, upstream tracking, pruning branches and origin versus upstream.

Git Stash

Park work in progress with git stash: apply versus pop, stash untracked files, name and inspect stashes, and decide when a branch is the better tool instead.

Undoing Changes in Git

Undo almost anything in Git: restore files, reset soft, mixed and hard, revert on shared branches, clean untracked files and recover a bad reset with reflog.

Git Tagging

Mark releases with Git tags: lightweight versus annotated, why push ignores tags, deleting them safely, tagging older commits and semantic-versioned releases.

GitHub Workflow with Git

Follow the GitHub pull request workflow end to end: fork versus clone, keeping a branch current, squash versus merge versus rebase, and reviewing well.

3Module 3: Interactive Rebase, History & GitOps

6 lessons
Advanced Git

Learn advanced Git: cherry-pick a commit, find a regression with git bisect, recover lost work with reflog and trace changes with blame, in learning order.

Git Hooks

Automate checks at commit and push time with Git hooks: where they live, why they never reach your team, client versus server hooks, --no-verify and Husky.

Git Workflows

Compare GitFlow, GitHub Flow and trunk-based development honestly, see which suits which team, why long-lived branches hurt and how feature flags help.

Git Aliases and Configuration

Configure Git once and stop fighting it: .gitconfig scopes, per-directory identities with includeIf, handy aliases and the defaults worth changing.

Git Submodules

Pin one repository inside another with Git submodules: clone with --recurse-submodules, know the two update commands, handle detached HEAD and subtrees.

Git Commit Messages

Write Git commit messages that stay useful: an imperative summary, a body that records why, Conventional Commits and enforcement with commitlint and Husky.