How to interface PHP and Git repository
Recently I was doing a project in which I had to provide a web interface for git repositories in my system. I was Coding in PHP and am l开发者_开发技巧ooking for a way to connect PHP to Git ie, to provide a PHP front end to git.
But can't find any libraries or references to proceed.
Have you looked at Git-PHP? http://code.google.com/p/git-php/
There is also:
glip
glip, a git library in PHP, enables your PHP scripts to access git repositories. Written in pure PHP5, it works without even having git installed, thus making it the ideal git library to use with your el-cheapo web hosting service.
GitPHP
GitPHP is a web frontend for git repositories. It emulates the look of standard gitweb, but is written in PHP and makes use of Smarty templates for customization. It has a couple extras, including syntax highlighting through the GeSHi PHP class and project category support. It works with standard git as well as msysgit on Windows.
I know this is old but I got here from Google and maybe this will help others. I found but did not test yet:
https://packagist.org/packages/sebastian/git
or https://github.com/sebastianbergmann/git
For those visiting this page in 2021, here is a currently active Git-PHP package (with tests) that you can use to perform common Git operations from PHP.
https://github.com/czproject/git-php
精彩评论