Public beta. We're in our soft launch: the lessons are ready, but things may still change, and your feedback shapes what comes next.

Learning path · 7 lessons · about 3½ h

Git: never lose your work again

Git is how you stop losing work. It keeps every version of your files, lets you try ideas without fear, and is how the whole software world works together. Programmers use it every day, and so do sysadmins, for scripts, configs, and eventually whole servers described as code.

Is this path for you?

You'll be comfortable here if you can already:

That's all of it. Linux Basics is plenty, and you don't need to have finished Linux Sysadmin. You also don't need a GitHub account: everything happens in the practice terminal, and the lessons show how the same commands work with GitHub when you're ready.

What's ahead

LessonYou'll learn to…
Save points for your workmake a repository, commit changes, look back with log and diff, undo mistakes with restore, and keep secrets out with .gitignore
Undo anythingthrow away changes, fix your last commit with --amend, undo a pushed commit with revert, the three kinds of reset, and rescue “lost” commits with reflog
Branches, merges & sharingtry ideas on branches, merge them, calmly fix a merge conflict, and share with push, pull and clone, on your own server or GitHub
Stash, cherry-pick & rebasepark unfinished work with stash, copy one commit with cherry-pick, and bring your branch up to date with rebase, fixing a conflict halfway through
Pull requests & code reviewconnect to GitHub, open a pull request, answer a review, update an out-of-date branch safely, and squash merge it
Tags, releases & finding the bad committag releases with version numbers, visit an old release, search history with log -S and blame, and let git bisect find the commit that broke something
Git on a server: tracking /etcset up etckeeper on Rocky and Ubuntu, commit config changes with a reason, see what package installs changed, and undo a bad edit
One rule before you start

Never commit passwords, keys or tokens. Git remembers everything, forever, and a public repository can be copied by anyone in seconds. You'll learn how to keep them out in the first lesson.

Send feedback

We're in a public beta, so every message helps. What's on your mind?

Please don't include your name, email or other personal details. We can't reply, but we read every one. We'll note which page you sent it from.