Git: Find duplicate blobs (files) in this tree

后端 未结 6 2103
长发绾君心
长发绾君心 2021-02-04 03:32

This is sort of a follow-up to this question.

If there are multiple blobs with the same contents, they are only stored once in the git repository because their SHA-1\'s

6条回答
  •  忘了有多久
    2021-02-04 04:20

    [alias]
        # find duplicate files from root
        alldupes = !"git ls-tree -r HEAD | cut -c 13- | sort | uniq -D -w 40"
    
        # find duplicate files from the current folder (can also be root)
        dupes = !"cd `pwd`/$GIT_PREFIX && git ls-tree -r HEAD | cut -c 13- | sort | uniq -D -w 40"
    

提交回复
热议问题