Git and GitHub Essentials: Version Control for Beginners

Free Git and GitHub course for beginners. 10 lessons with real terminal sessions: commits, branches, merge conflicts, pull requests, secrets and portfolio tips.

Beginner · 10 lessons

Git Basics

  1. What Are Git and GitHub? Install and Set Up Git - Understand what version control is, the difference between Git and GitHub, install Git on Windows, macOS or Linux, and set your name, email and default branch.
  2. Your First Git Repository: init, add, commit and log - Create a repository, learn the working folder, staging area and history, save changes with add and commit, read status and diff, and use .gitignore.
  3. Undo Mistakes in Git: restore, amend and revert - Learn safe ways to undo in Git: discard changes with restore, unstage files, fix the last commit with amend and undo shared commits with revert.
  4. Git Branches and Merging: Work on Ideas Safely - Learn what a branch is, create and switch branches, merge your work back with fast-forward and merge commits, read the graph and delete finished branches.
  5. Resolve Git Merge Conflicts Step by Step - Learn why merge conflicts happen, read the conflict markers, decide what to keep, finish the merge and avoid conflicts. A calm real session.

GitHub and Teamwork

  1. Put Your Project on GitHub: Remotes, push, pull and clone - Create a GitHub account and repository, connect it with git remote, push, clone and pull, sign in safely with SSH or a token, and fix a rejected push.
  2. Pull Requests, Forks and Code Review on GitHub - Learn the pull request workflow used by teams and open source: branch, push, open a pull request, review, merge, fork a project and keep your fork up to date.
  3. Good Commits, Clean Repositories and Keeping Secrets Safe - Write commit messages that help, keep commits small, use a README and a .gitignore, and learn what to do when a password or API key is committed by mistake.

Tools and Next Steps

  1. Stash, Tags and Exploring History: log, show and blame - Put unfinished work aside with stash, mark releases with tags, explore history with log, show and blame, and learn what cherry-pick and rebase are for.
  2. Using GitHub in Your Job Search, and a Git Cheat Sheet - Turn GitHub into a portfolio: good READMEs, pinned repositories, a profile README, GitHub Pages and honest contributions. Ends with a one-page Git cheat sheet.