Git & GitHub Course
Learn Git and GitHub: commits, branches and merging, pull requests, rebase, merge conflicts, stash and a practical team workflow.
11 lessons in 2 categories
Git Fundamentals
Git Fundamentals
What Git is, how it differs from GitHub, and the working tree/staging area/repository mental model -- via git init, status, add, commit, diff, and log. The 1st lesson in both the Git & GitHub course and its Git Fundamentals category.
Working With Commits
Writing good commit messages, browsing history with git log/git show, git commit -am, and understanding that git commit --amend creates a NEW commit rather than editing the existing one in place. HEAD and HEAD~1/HEAD~2 references.
Undoing Changes
Undoing working tree changes with git restore, the difference between git reset's soft/mixed/hard modes, and safely undoing shared commits with git revert. The relationship between HEAD, staging area, and working tree, and the data-loss risk of git reset --hard.
Branches & Merging
Creating, deleting, and renaming branches, switching with git switch, the difference between a fast-forward merge and a merge commit, an introduction to merge conflicts, and a realistic Spring Boot feature branch workflow. Why git switch is preferred over git checkout.
GitHub & Remotes
What a remote is, how git clone/push/fetch/pull work, the difference between fetch and pull (fetch: download without integrating, pull: fetch + integrate), tracking branches and git push -u, and synchronizing local and remote branches.
Pull Requests
What a Pull Request is, how to create/review/approve one through a realistic feature branch workflow, the difference between merge and squash-and-merge, deleting branches after merge, and branch protection rules.
Advanced Git
Rebase & Squash
What rebase is, how it differs from merge, squashing/reordering/rewording commits with git rebase -i, resolving rebase conflicts, the danger of rewriting shared history, and the difference between git push --force and --force-with-lease.
Merge Conflicts
What a merge conflict is, how to read conflict markers (<<<<<<<, =======, >>>>>>>), how to resolve one with real Java code examples, the same mechanics during both merge and rebase, and safely canceling with git merge --abort/git rebase --abort.
Stash
Saving uncommitted changes aside with git stash, the difference between apply and pop, multiple and named stashes, git stash drop/clear, and stashing untracked files. A realistic "interrupted mid-feature, need to switch tasks" scenario.
Advanced Git & Best Practices
git cherry-pick, git reflog (especially as a recovery mechanism for lost commits), git blame, aliases, good branch/commit conventions, and a comparison tying together merge/rebase/squash/revert. Git best practices for a development team.
Practical Git & GitHub Workflow
A closing lesson that ties together everything taught across the course in one continuous, realistic Spring Boot scenario: clone, feature branch, commit/amend, push, Pull Request, review feedback, rebasing onto main, resolving a conflict, force-with-lease, and squash and merge.