Two annual Git courses, run by C2SM as part of its technical training.
The folder beginner contains the exercises for Git: The Basics, an introduction to Git for people who have never used it. It covers the everyday commands: making commits, working with branches, resolving merge conflicts, and pushing to a remote.
The folder beyond contains the exercises for Git: Beyond the Basics. It picks up where the first course leaves off and needs nothing more than those basics. It has two parts: the commands beyond the basics (reading history, submodules, cherry-pick and rebase, stash and worktree, hooks, large files), and how a change travels through a shared project on a web interface (issues, forks, pull requests, review).
Both decks are published at https://c2sm.github.io/git-course/, as HTML and as PDF.
The HTML decks carry the presenter notes: press p while a deck is open for the presenter
view, with the current slide, the next slide, the notes and a timer. The PDFs contain the
slides only.
The sources are beginner/slides/slides.md and
beyond/slides/slides.md. To build a deck locally, run its
build.sh - it needs only Node.js and writes both the HTML and the PDF next to the source.
Pushing to main republishes the site.
Expert_Topics.md collects the topics neither course covers - Git internals, history rewriting, recovery, large repositories, signing - as a reading list.
To follow either course on your computer, you need:
- Git
- An SSH key linked to your GitHub account
- Git LFS (only for Git: Beyond the Basics)
- A final check
The courses are taught in a terminal, so you need a shell where Git works.
Important
You need at least Git 2.28 (released 27 July 2020).
Check yours with git --version.
Linux: follow Install Git on Linux.
macOS: follow Install Git on Mac.
Windows: install Git for Windows. It includes Git Bash, a terminal in which every command in these courses works, and Git LFS is already bundled. Git Bash is all you need, and it is the quickest route.
Alternative for Windows users: WSL2
If you would rather have a full Linux environment on Windows - useful well beyond this course - install the Windows Subsystem for Linux 2 (WSL2). It gives you a real Linux terminal, better compatibility with Linux-based workflows, and keeps your development environment separate from Windows.
- Enable WSL by following the Microsoft instructions.
- Install a Linux distribution from the Microsoft Store. We recommend Ubuntu 24.04 LTS.
- Open the Start menu, search for "Ubuntu" and launch it.
- Follow the prompts to set a username and password.
Then follow the Install Git on Linux instructions inside that environment.
A GitHub account lets you collaborate on shared projects and keep your own code in the cloud. An SSH key connects your computer to that account, so you do not have to type a password on every push, and it is considerably more secure.
Only the section under the corresponding heading in each link is relevant:
- Create a GitHub account (if you do not have one)
- Generate a new SSH key (leave the passphrase empty)
- Add the SSH key to your account
Only needed for Exercise 7 of Git: Beyond the Basics.
- Windows: already included in Git for Windows, nothing to do.
- macOS:
brew install git-lfs - Debian / Ubuntu:
sudo apt install git-lfs - Others: see https://git-lfs.com
Check with git lfs version.
Confirm your setup from a terminal:
- Step 1: download check_requirements.sh.
curl -O https://raw.githubusercontent.com/C2SM/git-course/main/check_requirements.sh
- Step 2: make it executable.
chmod +x ./check_requirements.sh
- Step 3: run it.
./check_requirements.sh --beginner
This also checks for Git LFS.
./check_requirements.sh
If every line reports success, you are ready.
Have fun!