Free Online Course · Self-paced
Git & GitHub Tutorial for Beginners (with examples)
Free, hands-on Git and GitHub tutorial that walks you from `git init` to advanced rebase, stash, and history rewriting in 14 chapters. 60+ examples tested on Linux, macOS, and Windows.
- 68 parts
- ~542 min total
- Beginner to Advanced
- Updated May 2026
Git is the single most important tool in modern software development - and also the one developers spend the most time fighting when they don't understand it. This course is built to make sure you never have to Google the same Git command twice.
We start from git init on an empty folder and walk through every workflow you will actually hit in real projects - branching, merging, rebasing, remotes, undoing mistakes, stashing, cherry-picking, history rewriting, and the day-2 troubleshooting questions every team eventually asks. Every chapter is short, every command is tested, and every example uses real files instead of toy foo.txt.
If you are brand new to version control, click Start the course and follow the chapters in order. If you already know the basics, skip straight to the chapter you need - Undoing Changes, Rebasing, and Troubleshooting are the most-bookmarked. The final chapter is a one-page cheat sheet you can keep open as a reference.
What you'll learn
- Set up Git, create your first repository, and stage / commit / push code confidently
- Master branching, merging, rebasing, and resolving conflicts the right way
- Work with remotes - GitHub and GitLab - including upstream tracking, force pushes, and SSH setup
- Undo every kind of mistake - bad commits, lost branches, deleted files, detached HEAD
- Use advanced tools - stash, cherry-pick, reflog, filter-branch, squash, tags - like a senior engineer
Prerequisites
- A workstation with Git installed (Linux, macOS, or Windows with Git Bash)
- Comfortable on the command line (cd, ls, mkdir, basic file editing)
- A free GitHub or GitLab account for the remote-workflow chapters
Syllabus
14 chapters · 68 lessons · ~542 min of reading
-
1 Getting Started with Git 5 lessons
-
2 The Basic Workflow - Add, Commit, Inspect 5 lessons
-
3 Branching and Switching 6 lessons
- Part 11 git branch - create and manage branches 14 min read
- Part 12 List all local and remote branches 7 min read
- Part 13 git checkout - switch branches (legacy way) 7 min read
- Part 14 git switch - the modern branch switcher 6 min read
- Part 15 Rename a Git branch 10 min read
- Part 16 Delete a Git branch (local and remote) 6 min read
-
4 Merging, Rebasing and Conflict Resolution 5 lessons
- Part 17 git merge - integrate two branches 7 min read
- Part 18 git merge vs git rebase - when to use which 5 min read
- Part 19 git rebase - replay commits onto a new base 12 min read
- Part 20 git cherry-pick - pick a single commit 6 min read
- Part 21 Fix "pulling is not possible - unmerged files" 6 min read
-
5 Working with Remote Repositories 12 lessons
- Part 22 git remote add - link to a remote 5 min read
- Part 23 git remote set-url - change the remote URL 7 min read
- Part 24 Remove a remote from your repository 6 min read
- Part 25 Set the upstream branch (git push -u) 7 min read
- Part 26 git fetch - download without merging 8 min read
- Part 27 git fetch vs git pull - the real difference 4 min read
- Part 28 git pull - fetch and merge in one step 6 min read
- Part 29 git pull --rebase - cleaner history 4 min read
- Part 30 Force pull from remote (overwrite local) 4 min read
- Part 31 git push - upload your commits 11 min read
- Part 32 git push --force-with-lease (safe force push) 7 min read
- Part 33 Check out a remote branch 7 min read
-
6 Tags and Releases 1 lesson
-
7 Undoing Changes (every level of undo) 11 lessons
- Part 35 Undo git add (unstage a file) 7 min read
- Part 36 Unstage multiple files at once 8 min read
- Part 37 git restore - the modern restore command Coming soon
- Part 37 Discard uncommitted changes in working tree 8 min read
- Part 38 git reset - soft, mixed, and hard explained 9 min read
- Part 39 git revert - undo a public commit safely 16 min read
- Part 40 Revert your repo to a previous commit 15 min read
- Part 41 Remove a commit from history 17 min read
- Part 42 Change an old commit message 7 min read
- Part 43 git clean - remove untracked files 7 min read
- Part 44 Remove untracked files from working directory 6 min read
-
9 File Management in Git 5 lessons
-
11 GitHub Integration (VS Code, SSH) 3 lessons
-
12 GitLab Workflows 2 lessons
-
13 Troubleshooting Common Errors 4 lessons
-
14 Reference / Cheat Sheet 1 lesson

