How to see the file size history of a single file in a git repository?

前端 未结 8 1686
遇见更好的自我
遇见更好的自我 2020-12-03 06:52

Is there anyway to see how a file\'s size has changed through time in a git repository? I want to see how my main.js file (which is the combination of several files and mini

8条回答
  •  不知归路
    2020-12-03 07:16

    In case this is of use for someone, this script will show the size of a given file in different commits:

    git log  | grep "^commit" | cut -f2 -d" " | while read hash; do
       echo -n "$hash -- "
       git show $hash: | wc -c
    done
    

提交回复
热议问题