Git & GitHub for Beginners
Track every change, work on branches and collaborate on GitHub with confidence
A free, complete Git and GitHub course for beginners. Learn commits, history, undoing mistakes, .gitignore, branches, merging and conflicts, then remotes, push, pull, pull requests and good team habits, with real terminal output, exercises with solutions and a quiz in every lesson. Finish by publishing your portfolio and running a team workflow.
- lessons
- 11
- lessons
- final project
- 1
- final project
- of learning
- 9 hours
- of learning
- level
- Beginner
- level
Who this course is for
- Beginners who have written some code or web pages and want to stop losing work
- Students and job-seekers preparing for developer, tester, DevOps or data roles, where Git is expected
- Anyone who wants to share projects on GitHub or contribute to open source
- Designers, writers and analysts who work with developers and want to follow the workflow
What you will be able to do
- Record your work in clear commits and read the history and differences
- Undo mistakes safely, and keep secrets and clutter out with .gitignore
- Work on branches, merge them and resolve merge conflicts
- Push to and pull from GitHub, and work on more than one computer
- Deliver changes through pull requests and code review, like a professional team
- Publish a project on GitHub and GitHub Pages with a README and a tagged release
Before you start
Skills you need
- Basic computer use: folders, files and typing
- Helpful but not required: a small project to practise with, such as the portfolio from HTML & CSS for Beginners
Cost and accounts
Free. Git and a GitHub account cost nothing; no card needed.
Setup time
About 10 minutes to install and configure Git (lesson 1).
Tools
- Git 2.28 or newer ↗Free from git-scm.com. Windows users get Git Bash, the terminal used in this course. Lesson 1 covers installing it on Windows, macOS and Linux.
- A code editor: Visual Studio Code ↗Free. Used to edit files and resolve conflicts. Any editor works.
- A free GitHub account (from lesson 8) ↗Lessons 1 to 7 need no account. The free plan covers everything in this course.
- GitHub CLI (macOS and Linux, optional) ↗The easiest way to sign in to GitHub from the terminal on macOS and Linux.
Checked with
- Every terminal example is run automatically with Git 2.53 in a fresh folder, and its output compared with the lesson; GitHub is stood in for by local repositories, so pushes, clones and pulls really run
- Commit ids in the lessons are the real ids those commands produce for the example learner (yours will differ, because your name, email and time differ)
- GitHub steps checked against the GitHub Docs on 2026-11-26
Last reviewed: 26 November 2026
Syllabus
Module 1: Git on your computer
Set up Git, make commits, read history, undo mistakes and ignore files.
- 1What Git and GitHub are, and setting up GitUnderstand version control and the difference between Git and GitHub, install Git on Windows, macOS or Linux, learn the five terminal commands you need, and tell Git your name and email.35 min
- 2Your first repository and commitsTurn a folder into a Git repository, check its state with git status, choose changes with git add, and save snapshots with git commit, understanding the working folder, staging area and history.35 min
- 3Viewing history and changesExplore a project's past with git log and git show, and see exactly what changed with git diff and git diff --staged, before and after staging, line by line.30 min
- 4Undoing changes safelyFix mistakes with confidence in Git: throw away unsaved edits with git restore, unstage files, amend the last commit, restore an old version of a file, and undo a shared commit with git revert.35 min
- 5Ignoring files with .gitignoreKeep secrets, downloaded libraries, logs and system files out of your repository with a .gitignore file, learn its patterns, and stop tracking a file you committed by mistake.25 min
Module 2: Branches and merging
Work on ideas separately and bring them together, conflicts included.
- 6Branches: working on ideas safelyUse Git branches to work on new features without touching the working version: create and switch branches with git switch, see where you are, commit on a branch and delete branches you no longer need.30 min
- 7Merging branches and fixing merge conflictsBring a branch's work into main with git merge, understand fast-forward and merge commits, and calmly resolve merge conflicts when two branches change the same lines.40 min
Module 3: GitHub and teamwork
Remotes, push, clone, pull, pull requests, READMEs, tags and Pages.
- 8GitHub: remotes and your first pushCreate a free GitHub account and repository, connect your local project with git remote, sign in securely, and upload your commits with git push, then see your code and history on github.com.40 min
- 9Clone, pull and fetch: working on more than one computerDownload a repository with git clone, bring in other people's commits with git pull, check for changes safely with git fetch, and fix a rejected push by pulling first.35 min
- 10Pull requests and working as a teamWork the way professional teams do: push a feature branch, open a pull request on GitHub, review and discuss changes, merge, then update your local copy. Also learn forks and issues.40 min
- 11READMEs, releases and good Git habitsMake your GitHub projects look professional with a README written in Markdown, mark versions with tags, publish with GitHub Pages, and adopt the everyday Git habits teams expect.35 min
Module 4: Final project
Publish your portfolio and deliver a change like a professional team.
Final project
Portfolio on GitHub with a team workflow
Publish a project safely on GitHub and GitHub Pages, deliver a feature through a pull request, resolve a teammate's conflicting change and tag a release.
You complete the course when every lesson is marked complete and your project passes its self-check rubric.
Prerequisites
None. This course starts from zero.
This course prepares you for
- JavaScript for Beginners · Build interactive projects worth putting on GitHub.
- Python for Beginners · Write programs and scripts, and keep them in Git from day one.