I have been came across this problem over and over again. I have a git repository set up on my remote server and all the files are set to 644 and folders are set to 755. How
As described in "Git set create mode to 100664 when pushing new folder/files to shared repo":
git doesn't store file permissions at the level you want. Having 644 or 664 files depends purely on
umask
."
(022
in your case, as commented by Jan Hudec
Git only stores two permissions (755=rwxr.xr.x
, 644=rw.r..r..
).
git simply doesn't track permissions.
In fact, it refuses to. Turns out there are enough mutually-exclusive definitions of how to do it right, all of which can be whipped up with simple scripting, that the simple scripting is the right way to implement it.
Plus, those rules are best left per-repo, because there's repo purpose and host OS to consider.