There are 3 possible ways git can find a file changed (even if you didn’t change it)
- Line Endings have changed
- File permissions have changed
- Bonus: if modification time has changed
for first case try these settings in bash shell. One of these will fix it for you
$ git config core.eol
$ git config core.autocrlf
$ git config core.safecrlf
For second case, here is the flag
git config core.filemode false
Bonus One: If Modification time was changed
If your working tree has files with updated “last modification time” and you see a huge list of files with “no content changes found”, try this:
git add .
// ^ dont use . [DOT] if you want to fix for particular sub-folder
You can do git add
for all affected files, after that it stops displaying them as modified in git status
(and doesn’t actually stage them for commit if there are no changes).
References: https://stackoverflow.com/a/37221298/2229148
Leave a Reply