Skip to main content
← blog/

TYPO3

How to list all subtrees or submodules of your git repository

Published by Sven Kalbhenn · 0 Comments

By default, there is no command to list all submodules or subtrees of a Git repository. But here you can find out how to do it.

By default git doesn't provide any command to list all subtrees of your current git repository.
For submodules you can use the submodule--helper, but this is not very convenient either.
So let's fix this:

Add list-subtrees and list-submodules as alias

Add to your ~/.gitconfig file the following aliases and save it:

 

[alias]    
	list-subtrees = !"for i in $(git log | grep git-subtree-dir | sed -e 's/^.*: //g' | uniq); do test -d $i && echo $i; done"    
	list-submodules = submodule--helper list

 

Now you can use the following command to list all the subtrees of your git repository:

 

cd myRepo/ 
git list-subtrees 
git list-submodules

 

If you know a better solution, please let me know: sven@skom.de

About the Author: Sven Kalbhenn

Senior TYPO3 Consultant & Software Architect

Comments (0)

No Comments

Write comment

Your email is never published.

* These fields are required