How can I list the git subtrees on the root? -
for example, can git remote --verbose , git show remotes have on project, git branch show branches , signal current branch, how list subtrees, without destructive command? git subtree give usage examples, won't list anything. subtree have add,pull,push,split,merge.
there isn't explicit way (at least, now), available commands listed here (as noted yourself, here's reference future seekers): https://github.com/git/git/blob/master/contrib/subtree/git-subtree.txt
i went through code (basically mechanism big shell script file), of tracking done through commit messages, functions use git log mechanism lots of grep-ing locate it's own data.
since subtree must have folder same name in root folder of repository, can run info want (in bash shell):
git log | grep git-subtree-dir | tr -d ' ' | cut -d ":" -f2 | sort | uniq now, doesn't check whether folder exist or not (you may delete , subtree mechanism won't know), here's how can list existing subtrees, work in folder in repository:
git log | grep git-subtree-dir | tr -d ' ' | cut -d ":" -f2 | sort | uniq | xargs -i {} bash -c 'if [ -d $(git rev-parse --show-toplevel)/{} ] ; echo {}; fi' if you're it, propose git guys include in next versions:)
Comments
Post a Comment