PHPackages                             davin-bao/php-git - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. davin-bao/php-git

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

davin-bao/php-git
=================

php git for laravel5

1862[1 issues](https://github.com/davin-bao/php-git/issues)PHP

Since Aug 28Pushed 8y ago1 watchersCompare

[ Source](https://github.com/davin-bao/php-git)[ Packagist](https://packagist.org/packages/davin-bao/php-git)[ RSS](/packages/davin-bao-php-git/feed)WikiDiscussions master Synced 5d ago

READMEChangelogDependenciesVersions (1)Used By (0)

PHP Git Client For Laravel
--------------------------

[](#php-git-client-for-laravel)

This project uses the Laravel 5.1 framework. Actually this is starter Laravel 5.1 project. It has add git repository, switch branch, checkout / delete branch .etc

1. [Bootstrap 3](http://getbootstrap.com/) - can be found in `Resources/`
2. [jQuery 1.10.1](https://jquery.com/) - can be found in `public/js/jquery.js`

Installation
============

[](#installation)

1. add code in composer.json

```
"davin-bao/php-git": "1.0-dev"

```

2. Add this to your service provider in app.php:

```
DavinBao\PhpGit\PhpGitServiceProvider::class,

```

3. Copy the package config to your local config with the publish command:

```
php artisan vendor:publish --provider="DavinBao\PhpGit\PhpGitServiceProvider"

```

4. SET umask 022 to umask 000 in /etc/profile

Configuration
-------------

[](#configuration)

config file is in app/config/phpgit.php

5. default, you can visit the url

http://your\_domain/\_tool/git

添加的新功能
------

[](#添加的新功能)

开始切换分支时 1.运行指定目录下php文件删除配置文件的修改 2.恢复当前分支对数据库修改的SQL执行

完成分支切换后 1.运行指定目录下php文件修改配置文件 2.执行对当前分支数据库修改的SQL

配置参数
----

[](#配置参数)

1.关于gitphp项目配置的添加

'path'=&gt;'sql文件的存放路径',

'install\_command' =&gt; \[

env('PHP\_GIT\_COMMAND', '（当前php文件的所在路径）php artisan patch:db -i'),

env('PHP\_SCRIPT\_COMMAND', '（当前php文件的所在路径）php artisan patch:script -i')

\],

'uninstall\_command' =&gt; \[

env('PHP\_GIT\_COMMAND', '（当前php文件的所在路径）php artisan patch:db -u'),

env('PHP\_SCRIPT\_COMMAND', '（当前php文件的所在路径）php artisan patch:script -u'),

\]

提示：必须是.env文件里没有配置 PHP\_GIT\_COMMAND 和 PHP\_SCRIPT\_COMMAND 参数才可生效

2.在 sql文件的存放路径 创建文件（\[branch name\] 分支名）

创建6个文件：

\[branch name\].php 修改配置文件参数脚本文件 需含有 install，uninstall 两个方法(只影响测试环境)

\[branch name\]-uninstall.sql 切换分支前执行的安装sql语句(只影响测试环境)

\[branch name\]-install.sql 切换分支后执行的卸载的sql语句(只影响测试环境)

\[branch name\]-production.php 修改配置文件参数脚本文件，该文件只用于合并生成只在生产环境生效的参数配置文件 需含有 install，uninstall 两个方法(只影响生产环境)

\[branch name\]-production-uninstall.sql 安装的sql语句，该文件只用于合并生成只在生产环境生效的sql语句文件(只影响生产环境)

\[branch name\]-production-install.sql 卸载的sql语句，该文件只用于合并生成只在生产环境生效的sql语句文件(只影响生产环境)

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/6d4bcfd83f5b742d5aeddbc12fdcd74806a7b79d770b613a707fe49bc74cd3d9?d=identicon)[davin-bao](/maintainers/davin-bao)

---

Top Contributors

[![davin-bao](https://avatars.githubusercontent.com/u/5162830?v=4)](https://github.com/davin-bao "davin-bao (4 commits)")

### Embed Badge

![Health badge](/badges/davin-bao-php-git/health.svg)

```
[![Health](https://phpackages.com/badges/davin-bao-php-git/health.svg)](https://phpackages.com/packages/davin-bao-php-git)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
