> 1) Every time I push from my local checkout to the remote master, I
> have to access my remote machine via ssh and do a 'git reset --hard'
> to get the changes to show up in the remote working directory --i.e.
> so Apache can access the files. Is there a way to automate this?
> 2) Every time I push and do above mentioned reset, file permissions
> for changed files are set at 0664, but I need them at 0644 for php
> files to be served without error. Since git doesn' track permissions,
> how do I tell git what permissions to use?
Use hooks, here is what i use
[fsh...@server58 hooks]$ cat post-update
# An example hook script to prepare a packed repository for use over
# dumb transports.
# To enable this hook, rename this file to "post-update".
echo "**** Pulling changes into Prime [Hub's post-update hook]"
cd $HOME/public_html || exit
git reset --hard HEAD
git pull hub master
/bin/chmod -R 755 /home/fshare/public_html
It set permission of the folder to 755, so php will work after commit.
I have set up repository as per
Also edit live sites .git/config set
filemode = false
So the chmod will be ignored.
You received this message because you are subscribed to the Google Groups "Git
for human beings" group.
To post to this group, send email to git-us...@googlegroups.com.
To unsubscribe from this group, send email to
For more options, visit this group at