问题
I have a repo on my server and can connect to it locally. My repo is located at:
public_html/example/repo
While my public folder is located at
public_html/example/public
Lets say I create an index.html "Hello World" file on my local, push it to my repo. I'd like to be able to see it right away in the web browser (so in the public folder). I know I can clone the repo into public and pull it in to see the changes, but I'd rather skip that extra step.
My question: Is it possible to view the latest and greatest version in a specific folder (public) every time someone pushes to the repository instead of having to pull in the files every time? If yes, what's the best way? Thanks in advanced. I would love to be able to just refresh my web browser to see the updates.
回答1:
You can create a post-receive hook in the repository that automatically refreshes the contents of your public folder.
More information about writing hooks can be found on the githooks(5) man page.
来源:https://stackoverflow.com/questions/5761273/can-i-view-instant-results-after-a-git-push