【问题标题】:how can I set up a website to mirror whatever is pushed to git?如何建立一个网站来镜像推送到 git 的任何内容?
【发布时间】:2010-10-25 06:36:40
【问题描述】:

我如何设置域来镜像托管在 git 存储库(github.com/nosppleasemam/dylanstestserver 和 dylanstestserver.com)上的文件。存储库是一个网站,所以我想托管存储在存储库中的文件,而不仅仅是镜像文件以供下载。

谢谢!

【问题讨论】:

    标签: git host mirror


    【解决方案1】:

    从该网络服务器,您可以将 cron 作业设置为频繁“拉动”。

    【讨论】:

    • 这看起来是最简单的解决方案,但我自己似乎无法弄清楚。你认为你可以引导我完成它或向我指出一些参考资料吗?我找不到任何可以说清楚的东西。
    • 所以你不确定如何使用cron?
    • 我尝试添加一个 cron 作业 'git pull git@github.com/nospampleasemam/dylanstestserver.git' 并确保它已运行,但我不知道文件在哪里结束?我已经搜索过,但似乎找不到任何东西
    • 试试这个:cd /var/www/html/yourwebroot && git pull git@github.com/nospampleasemam/dylanstestserver.git
    【解决方案2】:

    您可以use a hook 在服务器端签出存储库。

    (链接页面有错别字……是$REF,不是$RE

    【讨论】:

    • 这看起来可能很优雅,但我对如何实现它有点困惑,因为我正在使用 hostgator.com,并且没有对主机的 shell 访问权限,或者至少没有,我还没有以这种方式访问​​它。我应该尝试在 ssh 上使用这种方法吗?
    • @Nona Urbiz:你在哪个操作系统上?
    • 我正在使用 ubuntu?主机也是linux
    • 您可以在您的计算机上使用post-commit 挂钩。在ubuntu中安装ncftp包,并创建一个shell脚本.git/hooks/pre-commit运行ncftpput -u username -p password hostname /localdirectory /removedirectory
    猜你喜欢
    • 2017-03-31
    • 1970-01-01
    • 2014-01-19
    • 1970-01-01
    • 2021-02-27
    • 1970-01-01
    • 2016-02-29
    • 1970-01-01
    • 2011-09-02
    相关资源
    最近更新 更多