git - 使用 http 客户端直接从 gitolite 托管的 git 存储库访问文件

标签 git http gitolite

我正在使用 gitolite 托管 git 存储库,并设置了 ssh and http access .我可以使用 git cli 通过 ssh 和 http 克隆存储库。现在,我需要能够在不使用 git 客户端的情况下通过 http 从 git 存储库加载文件。具体来说,我需要向 Transifex 提供 URL https://git.example.com/myproject/locale/en/LC_MESSAGES/default.po翻译服务,以便它可以轮询对 .po 消息文件的更改。

有没有一种简单的方法可以直接使用 http 客户端访问此文件?

我已经尝试过一个选项:我们正在使用 Trac,它有一个内置的源代码浏览器并提供原始文件的链接,但每个 URL 都绑定(bind)到一个特定的修订散列 (example),没有链接选项到“最新”文件。

我考虑过设置一个post-receive Hook 来将此文件(或整个存储库)导出到网络可访问的位置。但是,我想知道是否可以通过 gitolite 直接访问存储库中的文件,而不是像这样的解决方法。

最佳答案

Git 将修订建模为 graph (即连接的节点),不像一大堆煎饼。 Git 中没有“最新”提交。有最新的提交日期,但这可能不是你想要的,而且要找到它也不是一件容易的事。您的意思可能是 master 分支的尖端。

一般来说,anything in Git that takes a hash (ie. 51e037aedb09735106f2e51520c3ff4430b663e3) will also take a reference (ie. master) .可以调整该 URL 以导出该文件的 master 版本。

https://trac.strangecode.com/pulso/export/master/locale/en/LC_MESSAGES/default.po

关于git - 使用 http 客户端直接从 gitolite 托管的 git 存储库访问文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32531512/

相关文章:

git - 服务器 Git 用户名在 GitHub.com 上的什么位置显示?

gitolite 安装问题

git - 如何授予用户访问 gitolite 中所有存储库的权限?

node.js - $ git Push 云致命 : remote error: Forbidden

git diff --name-only with ignore space 似乎被破坏了

node.js - Node Express - Http post 返回一个文件

java - Http 请求不完整

带有 Gitlab 的 Ruby Gems 没有要加载的此类文件 -- rb-inotify

git - TortoiseGit 图标覆盖桌面上的图标

java - 登录http网站java