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

前端 未结 8 1565
遇见更好的自我
遇见更好的自我 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:38

    On Windows I am using the following command:

    cmd /c "@echo off & for /l %N in (1 1 30) do git ls-tree -r -l HEAD~%N "C:\path\to\file.txt"
    

    It will show size of each of latest 30 versions.

    If somebody can convert that to Linux command you are welcome... ))

    0 讨论(0)
  • 2020-12-03 07:38

    Simply do:
    git log --stat /path/to/file

    Result:

    0 讨论(0)
提交回复
热议问题