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
Create a file called .gitattributes and add the following line:
main.js -diff
This turns off line-based diffs for main.js. Now run the following command:
git log --stat main.js
The log will include lines like
main.js | Bin 4316 -> 4360 bytes
After you're done, you should probably delete .gitattributes. I don't know what other changes in git's behavior may be caused by the -diff attribute.
Tested with git versions 1.7.12.4 and 1.7.9.5.
Source: ewall's answer and https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html#_marking_files_as_binary