Try setting core.fileMode to false as described here ( docs ) ( git config core.fileMode false should do the trick). Git seems to ignore any resolution changes during a hard reset. Now I found that if Git could not read the file (for example, I set the permissions to 000), a hard reset will restore the original permissions with which it was associated.
Another thought that might be of interest would be to write a hook that would set the permissions of all the files in the repo, whatever you want. It can also give you the confidence that you did not accidentally leave a new file with dangerous permissions.
source share