开发者

Can I view instant results after a git push?

开发者 https://www.devze.com 2023-02-28 09:46 出处:网络
I have a repo on my server and can connect to it locally. My repo is located at: public_html/example/repo

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 brow开发者_开发技巧ser to see the updates.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消