Git ändert die Berechtigungen meiner Datei, wenn ich auf den Server schiebe
Ich verwende Git, um eine Website auf einem Server zu verwalten.
Ich habe ein lokales Repository (siehe unten)
local@workstation:myapp$ ls -l | awk '{k=0;for(i=0;i<=8;i++)k+=((substr($1,i+2,1)~/[rwx]/)*2^(8-i));if(k)printf("%0o ",k);print}'
total 16
755 drwxr-xr-x@ 18 thomas staff 612 Jun 13 15:35 application
755 drwxr-xr-x@ 11 thomas staff 374 Jun 12 16:25 assets
644 -rw-r--r--@ 1 thomas staff 6399 Jun 22 11:45 index.php
755 drwxr-xr-x@ 10 thomas staff 340 May 14 15:22 system
Ich habe ein nacktes Repository auf dem Server, der verwendetpost-receive
das Repo vor Apache zu zeigen. Apache'spublic
Der Inhalt der Ordner befindet sich unterhalb von -not the bare repository.
root@server:/srv/public/myapp# ls -l | awk '{k=0;for(i=0;i<=8;i++)k+=((substr($1,i+2,1)~/[rwx]/)*2^(8-i));if(k)printf("%0o ",k);print}'
total 20
700 drwx------ 15 root root 4096 Jun 27 11:31 application
700 drwx------ 10 root root 4096 Jun 27 11:31 assets
600 -rw------- 1 root root 6399 Jun 27 11:31 index.php
700 drwx------ 8 root root 4096 Jun 27 11:31 system
Dies führt zu Chaos in meinem Code auf dem Webserver.
Wie kann ich das beheben? Ich benutze Gitolite, wenn das einen Unterschied macht.
Git-Server-Konfigurationsdatei
[core]
repositoryformatversion = 0
filemode = true
bare = true