我可以在git push后查看即时结果吗? [英] Can I view instant results after a git push?

查看:230
本文介绍了我可以在git push后查看即时结果吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的服务器上有一个存储库,可以在本地连接到它.我的仓库位于:

I have a repo on my server and can connect to it locally. My repo is located at:

public_html/example/repo

我的公用文件夹位于

public_html/example/public

让我们说我在本地创建了一个index.html"Hello World"文件,并将其推送到我的仓库中.我希望能够立即在网络浏览器中看到它(因此在公共文件夹中).我知道我可以将存储库克隆到 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.

我的问题:是否可以在每次有人将文件推送到存储库时查看特定文件夹(公共)中的最新和最新版本,而不是每次都必须拉入文件?如果是,最好的方法是什么?提前致谢.我希望能够刷新我的Web浏览器以查看更新.

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.

推荐答案

您可以在存储库中创建一个接收后挂钩,以自动刷新公用文件夹的内容.

You can create a post-receive hook in the repository that automatically refreshes the contents of your public folder.

有关写钩子的更多信息,可以在 githooks(5) 手册页中找到.

More information about writing hooks can be found on the githooks(5) man page.

这篇关于我可以在git push后查看即时结果吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆