How can I list the git subtrees on the root?

后端 未结 3 1505
一整个雨季
一整个雨季 2020-12-13 02:11

For example, you can do a git remote --verbose and git will show all the remotes you have on your project, git branch will show all the branches an

3条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-13 02:29

    The problem with grepping the log is this tells you nothing about whether the subtree still exists or not. I've worked around this by simply testing the existence of the directory:

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

提交回复
热议问题