After pushing files to our server, the following post-receive hook is executed:

```
#!/bin/sh
export GIT_WORK_TREE=/home/user/www/
git checkout -f

```

However, files get a very odd `600` permission, and folders `700` upon checkout. This is not what I expect (on our other servers we get `644` and `755`). From [this thread](https://stackoverflow.com/questions/14557106/git-changes-my-file-permissions-upon-checkout) I understand that git does not set permissions, so git is not to blame. My question is: what is? How can I figure out what the cause is of this issue? 

I have already temporarily solved it by running an extra script upon checkout to fix the permissions, but I am interested in solving the root cause.

I'm using gitolite to manage the repositories, but I doubt that is the cause. But again, I'm happy to learn where I can start because at this point I'm not sure how to investigate this. 

As per the initial answers I have looked into the umask settings on the server. The `git` user (that's the user used to upload the files), the umask setting is 0002. This is confirmed in the following exercise:

```
git@server:~$ umask
0002
git@server:~$ touch newfile
git@server:~$ ls -la newfile
-rw-rw-r-- 1 git git 0 Aug  5 10:46 newfile

```

Additional details:

* Linux used on both server side and development side
* In the local repo, permissions are 755 and 644
* filemode is set to true in .git/config