Git: where your changes actually live
Untracked, ignored, staged, committed, stashed, pushed, merged — every state a file passes through in Git, and the exact command that opens each door.
Git does not really track files, it tracks snapshots. At any moment every file on your machine sits in exactly one state, and a small handful of commands are the only doors between those states. This is the entire map, and it is smaller than most people expect.
Untracked
A brand new file is untracked. Git can see it sitting there, but flatly refuses to take responsibility: it will not appear in any commit, and if you delete it tonight nothing will warn you and nothing will bring it back. It is a guest, not a resident.
Ignored
Some files should never be tracked at all: build output, log files, the folder of downloaded libraries that can easily weigh hundreds of megabytes. A single ignore rule makes Git skip them silently forever, which is why almost every project creates one on day one.
Staged
Staging is the step newcomers find strange, and it is Git's best idea. The index is a draft commit you assemble piece by piece. You can even stage half of one file, so a single messy afternoon of work becomes two clean, separate, reviewable commits.
Committed
Committing writes a permanent snapshot into a hidden folder inside your own project, named by a forty character hash of its own contents. Change one comma anywhere and the hash is entirely different, and that is precisely what makes Git history tamper evident.
Modified
Open the file, type one character, and it becomes modified: your working copy no longer matches the last commit. Git screens candidates by size and modification time, then settles it by hashing the actual content, which is why touching a file without changing it leaves Git completely unimpressed.
Stashed
Stashing is the escape hatch for the moment a colleague asks you to look at something urgent right now. It sweeps your half finished changes onto a hidden stack, hands you back a clean working copy, and holds everything until you pop it out again.
Pushed
Pushing is the first moment your work exists anywhere except your own machine. Until then no backup, no teammate and no server has a single copy of it. If the laptop dies tonight, everything you have not pushed dies with it.
Conflicted
A conflict is not an error, it is Git refusing to guess. When two people change the same lines, it writes both versions into the file and stops. Note the precision: different parts of the same file merge silently, and only overlapping lines ever need a human.
Merged
Merging joins your branch into the shared history, and it leaves a distinctive mark: a merge commit is the rare one that points back at two parents instead of one. If nothing else moved meanwhile, Git skips even that and simply slides the branch label forward. Most teams put a review in front of this door.
Orphaned
Now the part that saves careers. A hard reset appears to destroy commits, but they are still sitting on disk, merely unreachable because no branch points at them any more. The reflog is a private diary of every position your branch has ever held, and it hands them straight back.
Collected
Only after roughly thirty days does Git's garbage collector finally delete what nothing points to. So the honest rule is this: once something is committed it is remarkably hard to lose, and everything before that first commit Git never knew about in the first place.
Watch it explain itself
Every step above is narrated aloud. Play it, or open it in the editor and make it yours — no account needed.