Course contentsShow
← Git & GitHub
Lesson 12 of 962. Core Git MechanicsFree lesson

Tracking Changes in the Working Directory

You will identify which files have been modified, created, or deleted by using the status command to inspect your project's current state.

In this lesson, you will learn how to use the git status command to peek behind the curtain and see exactly what has happened to the files inside your project folder.

The Git "Status" Report

When you are working on a project, you often create, edit, or delete files. Git doesn't automatically assume these changes are part of your project's history; instead, it waits for you to check in. To see what is happening in your "Working Directory" (the folder where your files live), you use the most important diagnostic tool in Git: git status.

Think of git status as a mirror. It reflects the current state of your files compared to the last time you saved a snapshot (a commit).

How to use it

Imagine you have a project folder and you have just created a new file named notes.txt and modified an existing file called index.html. If you type git status into your terminal, Git will tell you exactly what it sees:

$ git status
On branch main

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        notes.txt

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
        modified:   index.html

Understanding the Output

Git breaks your changes down into clear categories:

  • Untracked files: These are new files that Git sees in your folder but isn't watching yet. Git ignores these until you explicitly tell it to track them.
  • Changes not staged for commit: These are files that Git already knows about, but you have edited them since your last save.

By running this command frequently, you maintain complete visibility over your work. You are never left guessing whether you've remembered to save a new file or if you accidentally edited a file you didn't mean to touch. It is your primary way of ensuring that your "Working Directory" stays organized before you finalize your next big step.

Key Takeaway: The git status command is your primary tool for identifying which files you have created, modified, or deleted, allowing you to monitor the health of your project before moving forward.