How to git blame a directory

前端 未结 3 765
长发绾君心
长发绾君心 2021-02-06 23:35

I would like to know how to use git blame to know who created a single directory.

When I try:

git blame DIRECTORY_NAME

I get:



        
3条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-07 00:14

    To git blame the current directory:

    git ls-files -z | xargs -0n1 git blame
    

    I adapted the above from here: https://gist.github.com/Alpha59/4e9cd6c65f7aa2711b79

    A very very slow one-liner that goes through a git blame and sees how many lines were contributed by each author.

    It seems I needed to press spacebar and Q at least once to fully scroll through the list.

提交回复
热议问题