tools/git-basics-where-your-work-lives-and-why-branches-are-just-pointers.md
Git Basics: Where Your Work Lives and Why Branches Are Just Pointers
Git saves your project's history as commits: snapshots you choose to take, each with a short message. The trick to understanding it is knowing that your work lives in three places: your folder, a staging area for the next commit, and the history itself.
This guide walks through git status, add, commit and log with real output, then shows that a branch is just a movable name pointing at a commit. Two hands-on simulators let you stage files, take snapshots, and grow, switch and merge branches yourself.
$ ls tools/
see all →
tools/regular-expressions-describe-the-shape-of-text-and-watch-a-pattern-fin.md
Regular expressions: describe the shape of text and watch a pattern find it
A regular expression describes the shape of text instead of spelling it out, so one short pattern can find every phone number or check that…
tools/file-permissions-what-rwxr-xr-x-means-and-why-a-script-says-permission.md
File permissions: what rwxr-xr-x means, and why a script says Permission denied
You run your first script and the terminal says Permission denied. Nothing is wrong with your code: every file and folder carries read…
tools/git-stash-how-to-set-half-done-work-aside-without-committing-it.md
Git stash: how to set half-done work aside without committing it
You are halfway through a change when you need to switch branches, but the work isn't ready to commit. Git stash puts your unfinished edits…
tools/gitignore-how-git-decides-which-files-to-skip-and-the-one-rule-that-su.md
Gitignore: how Git decides which files to skip, and the one rule that surprises everyone
Why does a file show up in git status when you wanted it hidden, and why does a file you ignored sometimes stay tracked anyway? Five short…
tools/pipes-how-the-in-a-terminal-turns-small-commands-into-one-big-answer.md
Pipes: how the | in a terminal turns small commands into one big answer
How do you find the most popular page in a file of 15 million visits? In a terminal, you join small programs with the vertical bar `|`…
tools/git-branches-why-making-one-doesn-t-copy-your-project.md
Git branches: why making one doesn't copy your project
When someone says "make a branch for that," it sounds like Git must copy your whole project. It doesn't. A branch is just a name stuck on…