Tracking Changes
How to use `git status` to see what's changed and `git add` to prepare files for your next commit.
Status and Add
git status is your radar. It tells you exactly what Git sees in your Working Directory and Staging Area at any given moment.
git add is your staging tool. It takes modified or new files from your Working Directory and places them onto the Staging Area, ready to be committed.
Why it matters
Without git status, you are flying blind. You might accidentally commit a secret password file, or forget to include a crucial CSS file in your snapshot.
By constantly checking git status before you run git add, you maintain total control over your project history.
File states in Git
Files in Git can be in one of four states:
1. **Untracked**: New files Git has never seen before.
2. **Unmodified**: Files Git knows about, but haven't changed since the last commit.
3. **Modified**: Files Git knows about that you've changed, but haven't staged yet.
4. **Staged**: Files you have marked with git add to go into the next commit.
Check yourself
Pick an answer to lock it in, then read why. Getting one wrong is part of how it sticks.
Remember this
git statusshows the state of your files.git add <file>moves a file to the Staging Area.- Always run
git statusbeforegit add.
Done with this concept?
Mark it complete to track your progress. No login needed.