Topic 1

Git status

Check what changed before you stage, commit, or push.

Outcome

The current branch and every changed, staged, or untracked file can be identified before committing.

Before you start

  • The terminal is open inside a Git repository.
  • At least one known file change is available for comparison.

Check the current state

Open a new terminal with Ctrl + Shift + ` on Windows or Cmd + Shift + ` on macOS. Then enter the following command:

git status

Then you will see a result like this in the terminal:

Git status output in the terminal

Basic file states

The most important file states are:

State Meaning
tracked Git already knows about the file and watches it for changes.
modified The file has changed locally, but the change is not staged yet.
staged The change has been added to the next commit.
committed The change has been saved in the local Git history.
ignored Git intentionally leaves the file out because of an ignore rule.

If you can recognize the basic file states, you are ready to use git status more deliberately.

Common problems

  • A “not a git repository” error means the terminal is outside the project repository.
  • Generated LaTeX files should be reviewed before staging and may belong in .gitignore.

Completion check

git status reports the expected branch and the listed files match the changes you intended to make.