Git status - is there a way to show changes only in a specific directory?

Kuba Suder picture Kuba Suder · Apr 3, 2009 · Viewed 80.1k times · Source

I would like to see a list of files modified since the last commit, as git status shows, but I care only about files located in a single directory. Is there a way to do this? I tried git status <directory>, but it seems this does something completely different (lists all changed files, as they would be if I wrote git add <directory> first).

The documentation for git-status doesn't tell much, apart from the fact that it accepts the same options that git-commit does (but git-commit's purpose isn't to show lists of changed files).

Answer

Sam Doidge picture Sam Doidge · Dec 14, 2012

From within the directory:

git status .

You can use any path really, use this syntax:

git status <directoryPath>

For instance for directory with path "my/cool/path/here"

git status my/cool/path/here