Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to git list only the tracked directories?

Tags:

git

Using git list-files gives me the directories and the files tracked within. Is there a command like:

git list-directories

or something similar that lists only the tracked non-empty non-recursive directory names?

like image 458
tmaric Avatar asked Nov 27 '13 16:11

tmaric


1 Answers

git ls-files | xargs -n 1 dirname | uniq

like image 86
CDub Avatar answered Sep 22 '22 17:09

CDub