PHPackages                             appleboy/php-git-deploy - 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. [DevOps &amp; Deployment](/categories/devops)
4. /
5. appleboy/php-git-deploy

ActiveLibrary[DevOps &amp; Deployment](/categories/devops)

appleboy/php-git-deploy
=======================

Git Deployment with PHP

1.0.0(13y ago)35799BSDPHP

Since Sep 20Pushed 12y ago7 watchersCompare

[ Source](https://github.com/appleboy/PHP-Git-Deploy)[ Packagist](https://packagist.org/packages/appleboy/php-git-deploy)[ Docs](https://github.com/appleboy/PHP-Git-Deploy)[ RSS](/packages/appleboy-php-git-deploy/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

PHP-Git-Deploy
==============

[](#php-git-deploy)

Using `Post-Receive Hooks` to deploy muliple projects automatically. [![Build Status](https://camo.githubusercontent.com/74d79abd535b927dd5ce35aaafd58ac25a779770a1f98e40ac04dc65285cd356/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f6170706c65626f792f5048502d4769742d4465706c6f792e706e67)](http://travis-ci.org/appleboy/PHP-Git-Deploy)

Ref:

Requirements
============

[](#requirements)

PHP-Git-Deploy works with PHP 5.3 or later.

Installation via Composer
=========================

[](#installation-via-composer)

Create a composer.json file in your project root and use it to define simply your dependencies:

```
{
    "require": {
        "appleboy/php-git-deploy": "1.0.*"
    }
}

```

Then install Composer in your project (or download the composer.phar directly):

```
$ curl -s http://getcomposer.org/installer | php

```

And finally ask Composer to install the dependencies:

```
$ php composer.phar install

```

Installation/Usage
==================

[](#installationusage)

Download files
--------------

[](#download-files)

Download and drag the following files into your `application/` folder.

```
$ cp -r src/Web your_www/

```

Configure your profile
----------------------

[](#configure-your-profile)

open `src/Web/config.php` file with your editor. Following is config formats.

```
$config['github'] = array(
    'project_name' => array(
        'branch_name' => array('base_path' => 'folder_path')
    )
);
```

`project_name` must be the same with your github project name, for example:

Your github project URL is

The `project_name` value is `PHP-Git-Deploy`, don't case sensitive.

Please refer the following example profiles.

##### Single project, Multi branch profile

[](#single-project-multi-branch-profile)

```
array(
    'php-git-deploy' => array(
        'master' => array('base_path' => '/path/PHP-Git-Deploy_1/'),
        'develop' => array('base_path' => '/path/PHP-Git-Deploy_2/')
    )
);
```

##### Multi project, Multi branch profile

[](#multi-project-multi-branch-profile)

```
array(
    'php-git-deploy' => array(
        'master' => array('base_path' => '/path/PHP-Git-Deploy_1/'),
        'develop' => array('base_path' => '/path/PHP-Git-Deploy_2/')
    ),
    'codeigniter-my-model' => array(
        'master' => array('base_path' => '/path/CodeIgniter-MY-Model_1/'),
        'develop' => array('base_path' => '/path/CodeIgniter-MY-Model_2/')
    )
);
```

Create New index.php
--------------------

[](#create-new-indexphp)

Create new file `your_www/Web/index.php`, copy the following source code and paste into index.php file.

```
