Git & GitHub for Beginners
Save your work, undo mistakes, use branches, fix merge conflicts, and collaborate with pull requests — the first tool every company expects you to know.
Every developer job, every open-source project, and every tutorial on this site with a "source code on GitHub" link assumes you know Git. It's how you save your work, how you undo mistakes, and how teams of two or two thousand change the same code without overwriting each other.
This series starts with why version control exists, then builds one small project — a one-page personal website — from the first commit to a live site on the internet. Along the way you'll save snapshots, read history, undo mistakes safely, work on branches, cause (and fix) a merge conflict on purpose, push to GitHub, and open your first pull request. The final chapter publishes the site for free with GitHub Pages.
You'll type every command yourself in a terminal, so finish Command Line Basics first — this series uses the same shell setup (WSL or Git Bash on Windows), and chapter 2 has a quick recap of the few commands it relies on.
You need a computer running Windows, macOS, or Linux, a code editor (VS Code is a good free choice), and an internet connection for the GitHub chapters. Nothing costs money.
- 01What Is Version Control?Why final_v2_REAL.docx is a problem, what a snapshot is, how Git and GitHub differ, and the vocabulary you'll use for the rest of the series.
- 02Installing and Setting Up GitInstall Git on Windows, macOS, or Linux, tell it who you are, set sensible defaults, and recap the few terminal commands this series uses.
- 03Your First RepositoryCreate a repository with git init, learn the three areas — working directory, staging area, and history — and make your first commits with status, add, and commit.
- 04Reading HistoryRead the project's history with git log, see exactly what changed with git diff and git show, understand commit hashes and HEAD, and write commit messages your future self will thank you for.
- 05Undoing MistakesDiscard changes, unstage files, fix your last commit, revert a bad commit safely, go back in time with reset, and rescue 'lost' work with the reflog.
- 06BranchesWhat a branch really is, how to create and switch between them, and how merging works — both fast-forward merges and merge commits.
- 07Merge ConflictsCause a merge conflict on purpose, read the conflict markers, resolve it by hand or in VS Code, and learn the habits that keep conflicts small.
- 08Meet GitHubCreate a GitHub account, sign in from the terminal with the GitHub CLI, create a repository, push your project with git push, add a README, and clone it back down.
- 09Working with RemotesKeep several copies of a repository in sync with fetch, pull, and push, understand origin/main, fix a rejected push, and learn why you should never force-push a shared branch.
- 10Pull Requests and Team WorkflowThe GitHub flow real teams use: track work in issues, push a feature branch, open a pull request, review it, merge it, and clean up — plus forks for contributing to open source.
- 11Putting It All TogetherPublish my-site for free with GitHub Pages, ship one last feature through the full workflow, and keep a one-page Git cheat sheet for everything in the series.