TetSharing

Git & CLI tutorial

Drive your computer from the terminal and track every change with Git. 12 short chapters, one idea each, every example runnable in the page.

Who it's for: Beginners who have never opened a terminal, and coders who use Git through buttons and want to know what the commands do.

Prerequisites: A terminal (Terminal on macOS, Git Bash or WSL on Windows) and Git installed. Transcripts show exactly what each command prints.

Start with chapter 1 →

Dense lines of code in a dark editor
Photo: juanjodev02 on Unsplash

How this track works

The first three chapters teach just enough of the terminal to be comfortable: moving between folders, handling files, and chaining commands with pipes. The rest is Git, from the first git init to merging, resolving conflicts, undoing mistakes and sharing work through a remote.

Examples are terminal transcripts: lines starting with $ are commands, the rest is what they printed. Our test suite runs every transcript with bash and Git in a brand new temporary folder with a fixed author name and date, and the build fails if the output changes. Commit hashes in your own repositories will differ from ours, and that is expected. Explanations link to the official Git documentation at git-scm.com.

All 12 chapters

  1. 01Terminal basics
  2. 02Working with files
  3. 03Pipes and redirection
  4. 04What Git is
  5. 05Staging and commits
  6. 06Viewing history
  7. 07Comparing changes
  8. 08Branches
  9. 09Merging
  10. 10Merge conflicts
  11. 11Undoing changes
  12. 12Remotes, push and pull
A laptop with code on the screen on a table in a bright office
Photo: jstrippa on Unsplash
A laptop with code on a clean white desk near a window
Photo: cgower on Unsplash

Practice and reference

Final Git & CLI quiz (12 questions)Cheat sheet: git commandsCheat sheet: linux shell commandsOfficial Git & CLI documentation