Git Version 1.9.1
Ubuntu 14.04 LTS Server
LAMP server
I installed my LAMP server to update my working directory of my Git repository when one of my web developers clicks on the change server. I noticed that the log will notice new commits, but will not update the working directory. Instead manually (git check -f) for each update, it can be set automatically to do this after receiving a click.
- In your ".git" directory, go to the "hooks" folder.
Create a file called "post-receive" in the "hooks" folder with this content:
#! / Bin / w
# Updating the working directory after receiving push from remote clients.
# This should be directed to the Git working directory.
GIT_WORK_TREE = / var / www / dev_site Git checkout -f
Enable permissions to execute the file by typing "chmod + x post-receive" into the "hooks" folder.
Now it will update the working directory when commits are moved to the Git repository. My site now shows changes when I visit it in a browser.
My working directory is / var / www / dev_site
Danny virasawmi
source share