git推送后我可以查看即时结果吗?
我的服务器上有一个存储库,可以在本地连接到它。我的存储库位于:
public_html/example/repo
而我的公共文件夹位于
public_html/example/public
假设我创建了一个 index.html“Hello World”文件在我本地,将其推送到我的存储库。我希望能够立即在网络浏览器中看到它(因此在公共文件夹中)。我知道我可以将存储库克隆到 public 中并将其拉入以查看更改,但我宁愿跳过这个额外的步骤。
我的问题:每次有人推送到存储库时,是否可以在特定文件夹(公共)中查看最新和最好的版本,而不必每次都提取文件?如果是,最好的方法是什么?提前致谢。我希望能够刷新我的网络浏览器来查看更新。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以在存储库中创建一个接收后挂钩,该挂钩会自动刷新公用文件夹的内容。
有关编写钩子的更多信息可以在
githooks(5)
上找到手册页。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.