Incorrect file resolution when using git to pull the hook

I created the following git hook to update my web application when new changes are pushed to the repository

#!/bin/sh
#Update the server version to HEAD

echo "Updating webapp..."
unset $(git rev-parse --local-env-vars)
(cd /var/www/webapp && git pull -q)

However, if I add new files, they get the wrong permissions. They can only be read by the owner, not by a group or other users. But I need everyone to read them. Locally they have the correct resolution bits. And even when I launch the hook manually from the shell, it works correctly. This does not work when the script is called as a hook.

Any ideas how to fix this?

PS: I am using git 1.7

+5
source share
1 answer

Git , . , , umask.

, , umask. umask umask shell. , 0022, , .

+8

All Articles