在没有 Git 的情况下读取 Git 存储库

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/645814/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 03:37:04  来源:igfitidea点击:

Reading a Git repository, without Git

phpgitversion-control

提问by ANaimi

I'm researching the idea of building a super-small (preferably PHP) web app, which will serve (among other things) as a minimal front-end to a git repository.

我正在研究构建一个超小型(最好是 PHP)Web 应用程序的想法,该应用程序将(除其他外)用作 git 存储库的最小前端。

Any library/article for reading a git repository(".git" folder) without having to execute the "git" process?I'm looking for an API to manage a git repository. I'm only interested in basic functions, such as reading last commits (name of commiter, commit note, date), displaying and traversing branches...

无需执行“git”过程即可读取 git 存储库(“.git”文件夹)的任何库/文章我正在寻找一个 API 来管理 git 存储库。我只对基本功能感兴趣,例如读取上次提交(提交者名称、提交说明、日期)、显示和遍历分支...

Thanks, ANaimi

谢谢,阿奈米

回答by Pat Notz

You may also want to check out the Cgitproject since they've done something similar (except they build their own git library -- also to avoid running gitdirectly).

您可能还想查看Cgit项目,因为他们做了类似的事情(除了他们构建自己的 git 库——也避免git直接运行)。

There's JGit, a pure Java implementation, that may be useful to you.

JGit,纯Java实现,这可能是对你有用。

回答by Cesare D'Amico

Try also glip, a pure php implementation of git, which was extracted from eWiki.

还可以尝试glip,它是 git 的纯 php 实现,它是从 eWiki 中提取的。

回答by Jakub Nar?bski

I think that best start in such case could be Interfaces Frontends And Toolspage on Git Wiki.
You can find there link to eWiki(github) which supposedly uses native (in PHP) access to Git.

我认为在这种情况下最好的开始可能是Git Wiki 上的Interfaces Frontends And Tools页面。
您可以在那里找到eWiki( github) 的链接,该链接据称使用本机(在 PHP 中)访问 Git。