On Sun, 16 Mar 2025, to...@tuxteam.de wrote:
Git *does* preserve permissions [1]. For the ownerships (and more accurate
mtime, atime and ctime) cf. etckeeper.
Git only tracks the execute bit. And because it always writes a new file
rather than truncate then write by most editors, the permissions get
reset very easily:
$ touch test
$ chmod 700 test
$ git add test
$ echo >>test
$ ls -l test
-rwx------ 1 tim tim 1 Mar 16 07:45 test
$ git checkout test
Updated 1 path from the index
$ ls -l test
-rwxrwxr-x 1 tim tim 0 Mar 16 07:46 test