Himanshu SharmaSoftware engineer
Let’s talk

Beginner to intermediate · 30 lessons

Git and GitHub for beginners

A practical Git and GitHub course for beginners. Learn commits, branches, merging, rebasing, remotes, pull requests, team workflows and recovery, then finish with a shared project using a local remote.

Syllabus

Why version control

  1. What version control is and why every project needs it10 min
  2. Installing Git and setting your name and email12 min
  3. The three areas of Git: working tree, staging area and repository12 min

Your first commits

  1. Your first repository: init, add and commit14 min
  2. Reading project history with git log, diff and show14 min
  3. Keeping files out of Git with .gitignore13 min

Undoing things safely

  1. Discarding changes and unstaging files with git restore11 min
  2. Fixing the last commit: amend and the three kinds of reset14 min
  3. Undoing shared history with revert, and finding lost work with reflog13 min

Branches and merging

  1. Branches: creating, switching and deleting them14 min
  2. Merging branches: fast-forward and merge commits12 min
  3. Resolving merge conflicts step by step14 min
  4. Rebasing: replaying a branch onto a new base, and when not to15 min

Remotes and GitHub

  1. Remotes: clone, fetch, pull and push16 min
  2. GitHub accounts, SSH keys and access tokens explained in words12 min
  3. GitHub repositories, README files and licences13 min
  4. Issues and pull requests on GitHub14 min
  5. Forks and code review on GitHub13 min

Workflows and teamwork

  1. Writing commit messages people can use later12 min
  2. Team workflows: feature branches, GitHub flow and trunk-based development14 min
  3. Working in a team with Git: habits that prevent trouble13 min

Power tools

  1. Shelving unfinished work with git stash12 min
  2. Marking releases with Git tags12 min
  3. Copying single commits with cherry-pick11 min
  4. Finding the commit that broke things with git bisect13 min
  5. Submodules: a repository inside a repository13 min
  6. Git hooks: running scripts at commit time13 min
  7. GitHub Actions at a glance: automation on every push11 min

Recovery and final project

  1. Recovering from common Git mistakes15 min
  2. Final project: collaborate on a shared reading list30 min