What Does git add . Do? A Simple Guide to Staging Changes in Git
When you’re working with Git, you’ll quickly run into the command git add .. It’s short, it’s common, and it can be a little confusing if you’re not sure what’s happening behind the scenes.
This guide walks through what git add . actually does, why it matters, how it compares to similar commands, and when its behavior can change depending on your setup.
The basics: what git add . really does
In plain language, git add . tells Git: “Take all my changes in this folder (and its subfolders) and put them in the staging area.”
Three key ideas sit behind that:
Your working directory
This is the set of files and folders you’re editing on disk right now.The staging area (also called the index)
Think of this as a “pending changes” list. Only staged changes are included in the next commit.A commit
A snapshot of staged changes, with a message, stored in your Git history.
When you run: