1

I have a file that am tracking with git in a project, whenever i change the mode of the file to anything mode other than granting write access to the file, git ignores those changes ( which is causing a bug in the project ).

for example a file edit.json if i change the mode with

chmod 666 edit.json

git ignores that the mode of the file have changed ( especially if i turn on write access to the file for group and others )

How can i get pass this problem ?

0.sh
  • 2,659
  • 16
  • 37
  • 4
    Git only saves whether a file is executable and/or symlinked - https://stackoverflow.com/a/3211396/3001761 – jonrsharpe Jul 23 '17 at 14:23
  • 1
    maybe this helps: https://stackoverflow.com/questions/2517339/how-to-recover-the-file-permissions-to-what-git-thinks-the-file-should-be – SAM Jul 23 '17 at 14:24
  • thanks for answers. I tried them all, but whenever i push my code to a remote branch , the file permission still remain the same – 0.sh Jul 23 '17 at 16:17
  • 4
    @0.sh: to amplify (to the point of distortion, but maybe it will do the trick :-) ) jonrsharpe's comment, the fundamental problem is that Git doesn't *store* the mode of the file. You **cannot** make the file a+w through Git itself. You **must** use something other than Git itself to store and set this. – torek Jul 23 '17 at 19:49

0 Answers0