Course contentsShow
← Data Science
Lesson 1997 of 2,14546. Version Control with GitFree lesson

Viewing Repository State with git status

Using git status to see tracked, untracked, and modified files, and interpreting status output for next actions.

Viewing Repository State with git status

You'll learn how to use git status to inspect what's happening in your Git repository and decide what to do next.

What is git status?

Think of git status as your repository's dashboard — it shows you exactly what Git sees right now: which files have changed, which are ready to be committed, and which Git isn't tracking at all. It's the command you'll run most often, usually before and after every other Git operation.

Understanding the Output

When you run git status, Git categorizes your files into three groups:

Untracked files: Files Git doesn't know about yet (never staged or committed). These appear in red and need git add to start tracking them.

Changes to be committed (staged): Files you've added to the staging area with git add but haven't committed yet. These appear in green and are ready for git commit.

Changes not staged for commit (modified): Files Git is tracking that you've changed since the last commit, but haven't staged yet. These appear in red and need git add to stage them.

Example Workflow

git status
# Shows which scripts are modified, staged, or untracked

# You see analysis.py is modified but not staged
git add analysis.py

git status
# Now analysis.py appears in "Changes to be committed"

git commit -m "Updated analysis script"

git status
# Clean working tree - everything is committed

Why This Matters in Data Science

Before committing your analysis notebook or updated model code, git status helps you verify you're not accidentally including temporary files, large datasets, or credentials that belong in .gitignore.

Key Takeaway: git status is your situational awareness tool — run it frequently to understand your repository's current state and determine whether you need to stage, commit, or clean up files before proceeding.