How to list files in git only upto n-levels? -


i want list files tracked in git repository.

so, git ls-files. doing so, gives me entire list including sub-directories, sub-directories , on..

i not want this. there way can specify depth of output of ls-files command?

suppose have git repo:

mainrepo/    sub-dir1        subdir1.1           subdir1.1.1    sub-dir2 

i want go depth 1, perse. means want ls-files ouput

sub-dir1 sub-dir2 

a rudimentary way strip each line (and including) optional / character, , unique lines that:

$ git ls-files | cut -f1 -d/ | uniq 

(note haven't been able test yet, because i'm on windows using limited bash shell.)


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -