> 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 #!/bin/sh # # 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 echo "**** Pulling changes into Prime [Hub's post-update hook]" echo cd $HOME/public_html || exit unset GIT_DIR git reset --hard HEAD git pull hub master /bin/chmod -R 755 /home/fshare/public_html exec git-update-server-info [fsh...@server58 hooks]$ It set permission of the folder to 755, so php will work after commit. I have set up repository as per http://joemaller.com/2008/11/25/a-web-focused-git-workflow/ 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/git-users?hl=en.
