1

How can I get git-status of a single folder in a non-recursive way?

This is not a duplicate of this question since they address there how to git-status a single folder and it subdirectories, e.g. the accepted answer there is to use git status . which returns a recursive result.

Community
  • 1
  • 1
Yuval Atzmon
  • 5,165
  • 2
  • 32
  • 67

1 Answers1

2

go into the desired folder and the use:

git status .

This will display the status of the given folder which you are in right now.

Another option is to use:

git ls-files -t -o -m <desired path>

This would display all files changed but not updated (unstaged), or untracked for the given directory.


Non recursive way:

In the desired folder use the combination of git status + grep to filter the results

git status | grep -v /
Community
  • 1
  • 1
CodeWizard
  • 110,388
  • 20
  • 126
  • 153