Guide Hub

Git & GitHub Masterclass

Git is the foundation of modern software version control. Whether you're working solo or on a team of hundreds, understanding Git deeply will make you a more effective developer. This masterclass brings together everything you need — from your first commit to advanced internals.

17 lessonsStructured path
Your progress0/17 lessons

0% completed on this device.

Who this guide is for

  • Beginners who have never used version control and want to make their first commit today.
  • Developers who use Git every day but get nervous around rebase, reset or merge conflicts.
  • Team leads choosing a branching workflow and pull request process on GitHub.

1. What is Git?

Git is distributed version control that stores your project as snapshots, so you can commit, branch, and collaborate reliably.

What is Git? →

2. Git vs GitHub

Git is the version control engine; GitHub is the collaboration platform that hosts repos and adds PRs, issues, CI/CD, and reviews.

Git vs GitHub: What’s the Difference? →

3. Git Repositories

A repository (repo) is your project directory tracked by Git — including the hidden .git data that stores history and configuration.

Build Your Own Git From Scratch →

4. Git Commits

A commit is a snapshot created when you run git commit using what you staged with git add. Commits also store parent history so Git can build timelines.

Build Your Own Git From Scratch →

5. Git Branches

Branches are pointers to commits. Creating one is fast, and it lets you experiment without disturbing main.

Git Branches: The Fastest Way to Work Without Fear →

6. Git Merge

Git merge combines two branches (usually a feature branch into main). It preserves real history and records where two lines of work joined.

Git Merge: When You Want Real History (Safely) →

7. Git Rebase

Rebase replays your commits on top of another branch, creating a cleaner-looking history. It rewrites commit hashes, so only do it on branches you own.

Git Rebase: Clean History Without Panic →

8. Git Merge vs Rebase

Merge preserves the real timeline (and doesn't rewrite history). Rebase rewrites commit hashes into a cleaner linear story — so use it on branches you own.

Git Merge vs Rebase: The Difference Every Developer Should Know →

9. Git Stash

Stash temporarily stores your work-in-progress so you can switch branches and come back later.

Git Stash: Save Work Temporarily (Without Committing) →

10. Git Cherry-Pick

Cherry-pick applies one specific commit from another branch onto your current branch (without merging the entire branch).

Git Cherry-Pick: Copy One Commit (Not a Whole Branch) →

11. Git Reset

git reset moves your branch pointer backward. Pick --soft, --mixed, or --hard depending on whether you want to keep staged files or discard work.

Git Reset: Undo Commits (Soft, Mixed, or Hard) →

12. Git Reflog

Reflog is Git’s local time machine: it records moves of HEAD so you can recover after resets, rebases, and other mistakes.

Git Reflog: Your Local Time Machine →

13. Merge Conflicts

Conflicts happen when Git can't automatically combine changes to the same lines. Resolve by choosing the final code, staging it, and finishing your merge/rebase.

Git Conflicts: Resolve Faster (and Stay Sane) →

14. Git Workflows

A workflow is the agreement your team makes about how to use branches, when to review, and how to release. Start simple: small feature branches + early PRs + CI before merging.

Git Workflows: The Basics That Keep Teams Moving → · Git Workflow Guide: From Chaos to Clarity →

15. Working With GitHub

GitHub adds collaboration on top of Git: PRs for review, issues for tracking, and CI/CD for automation.

Git & GitHub: From Zero to Collaborating Like a Pro →

16. Git Aliases

Aliases turn repetitive Git commands into muscle memory. Instead of typing the same long command, you use a short shorthand.

Git Aliases: Type Less, Move Faster →

17. Troubleshooting Git

When Git breaks, the fastest fix is knowing the right rescue command. This pillar points you to the recipe-style troubleshooting guide.

Oh Shit, Git?! — Rescue Recipes in Plain English →

Frequently asked questions

What is the difference between Git and GitHub?

Git is the version control program that runs on your computer and records snapshots of your project. GitHub is a website that hosts Git repositories and adds pull requests, issues, code review and CI. You can use Git without GitHub, but not the other way round.

Should I use git merge or git rebase?

Merge keeps the exact history and is safest on shared branches. Rebase rewrites your commits on top of the latest main for a straight history, which is great for your own feature branch before a pull request. Never rebase commits other people have already pulled.

How do I undo my last Git commit?

If you haven't pushed it, git reset --soft HEAD~1 removes the commit and keeps your changes staged. If it's already pushed, use git revert HEAD, which adds a new commit that undoes it without rewriting shared history.

How long does it take to learn Git?

The everyday commands, add, commit, push, pull and branch, take an afternoon. Feeling comfortable with merge conflicts, rebase and recovering from mistakes usually takes a few weeks of real use. This guide is ordered so you can stop at whatever level you need.

How do I recover a deleted branch or lost commit?

Run git reflog. It lists everywhere HEAD has pointed recently, including commits no branch refers to any more. Find the commit hash and run git branch recovered <hash> to bring it back.

Contact

Get in Touch

Want to call me? book a call and I'll respond in the available time slot. I will ignore all soliciting.