Git change default umask when update file
===

I have a problem with Git. I searched for solution in google and in stackoverflow but nothing helps.

The problem is that everytime when git updates some file in working directory (when i checkout branches or i merge branch etc) then file permissions are changed "writable to group" flag is added.
And my apache show "Error 500" for file if it is writable to group.

Example:
I have file index.php . permissions are "-rwxr-xr-x" . Current (active) branch is master. This file was changed in branch develop.
I execute "git checkout develop" and the file index.php gets permissions "-rwxrwxr-x" (writable to group is added). And my site stops to work. As apache doesn't allow this flag in php files (i don't know why but i can not change this).

Every time when i execute "git checkout develop" i need to execute also "chmod g-w index.php". I don't like to execute 2 commands (and sometimes i forget to execute this and my site doesn't work)

What can i do to solve this problem?
I think this is something related to umask. I did some tricks i found on web, but nothing works.

Thanks.