gitdirectorystatus

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


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).


Solution

  • 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