How can I list the git subtrees on the root?

后端 未结 3 1488
一整个雨季
一整个雨季 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:40

    Following up on Sagi Illtus' answer, add the following alias to your ~/.gitconfig

    [alias]
        ls-subtrees = !"git log | grep git-subtree-dir | awk '{ print $2 }'"
    

    Then you can git ls-subtrees from the root of your repository to show all subtree paths:

    $> cd /path/to/repository
    $> git ls-subtrees
    some/subtree/dir
    

提交回复
热议问题