Do not use just git to manage the file permissions of an installed tree.
git is single user. It does not track file ownership and permissions sufficient to secure a multiple user system. Even if a simple tree wide core.sharedrepository
with one user were sufficient for your use case, you are having difficulty getting it do what you want. Possibly its still using the default of umask
?
Consider a real archive format, either a software package system, or generic archive like tar. Get the permissions correct in the scripts that generate the archives.
Or, running a permissions fix script isn't that bad. If desired, check permissions prior to changing them, to avoid unnecessary changes to file metadata.
Unrelated consideration: if this tree is going to be updated, be aware that git doesn't sync files, it merges histories. Understand these git deployment rules to appreciate why scripting just git pull
is probably wrong.