I have files in my git directory that have permission 600.
When I used
git-pull in my computer and
git-push in another computer, the permission changes to 664.
Is there a way to preserve permissions(600) after
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
As mentioned by @Kusalananda,
git normally only tracks execute permissions. In order to save more permissions information, you would need to implement a pre-commit hook that would gather up the permissions info and store it separately, and another hook to restore permissions on pull.
etckeeper is basically a collection of tools that does this for the purpose of placing your
/etc directory under version control. You might want to adapt it to your purposes, or perhaps study what it does to do something similar yourself.