pascalmh/git.php

此包已被放弃,不再维护。没有建议的替代包。
关于此包的最新版本(1.0.0)没有可用的许可证信息。

1.0.0 2017-02-09 16:55 UTC

This package is not auto-updated.

Last update: 2023-05-08 09:05:41 UTC


README

Click here to lend your support to: Git.php and make a donation at pledgie.com !

描述

PHP git 仓库控制库。允许从 PHP 类中运行任何 git 命令。使用 proc_open 运行 git 命令,而不是 exec 或类似命令,因此可以在 PHP 安全模式下运行。

要求

已安装 git 的系统

基本使用

require_once('Git.php');

$repo = Git::open('/path/to/repo');  // -or- Git::create('/path/to/repo')

$repo->add('.');
$repo->commit('Some commit message');
$repo->push('origin', 'master');