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:
- Move around and make, copy and delete files in the terminal (Linux Basics, lesson 8)
- Put text into files with
echoand>, or an editor like nano - Install software on Rocky or Ubuntu (Linux Basics, lesson 11)
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
| Lesson | You'll learn to… |
|---|---|
| Save points for your work | make a repository, commit changes, look back with log and diff, undo mistakes with restore, and keep secrets out with .gitignore |
| Undo anything | throw 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 & sharing | try 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 & rebase | park 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 review | connect 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 commit | tag 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 /etc | set up etckeeper on Rocky and Ubuntu, commit config changes with a reason, see what package installs changed, and undo a bad edit |
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.