I had the same problem with the *.js files locally stored in git. Git changed the end-of-line from LF (unix) to CRFL (windows). The HASH is not valid after that.
In this case, you need to tell git to keep eol as needed using a file .gitattributes with lines of type:
/my/path/to/file.js eol=lf
Use the command dos2unix on the file before commit to fix the file.