After pushing files to our server, the following post-receive hook is executed:
git checkout -f
git@server:~$ touch newfile
git@server:~$ ls -la newfile
-rw-rw-r-- 1 git git 0 Aug 5 10:46 newfile
However, files get a very odd 600 permission, and folders 700 upon checkout.
It looks like your shell has a restrictive umask setting, possibly
From this thread I understand that git does not set permissions, so git is not to blame.
No, it is the
umask setting of your shell.
My question is: [...] [how] can I figure out what the cause is of this issue?
umask, it will tell you what is your current setting. It's like to be
0177 or similar.
If you want to know why,
you need to look through the rc files used by
.bashrc, and other files sourced.
You can have very restrictive
umask settings but override them in your script, by adding a
umask line as @VonC suggested.