Can I view instant results after a git push?

时光毁灭记忆、已成空白 提交于 2019-12-24 08:59:58

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!