PHPackages                             mlukman/gitsync - 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. mlukman/gitsync

ActiveProject

mlukman/gitsync
===============

GitSync allows system admin to sync contents of a directory with a specific branch of a Git repository.

1.1.4(8y ago)129GPL-1.0-or-laterPHPPHP &gt;=5.6.0

Since Apr 26Pushed 8y ago1 watchersCompare

[ Source](https://github.com/MLukman/GitSync)[ Packagist](https://packagist.org/packages/mlukman/gitsync)[ Docs](https://github.com/MLukman/GitSync)[ RSS](/packages/mlukman-gitsync/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (6)Versions (32)Used By (0)

[![GitSync logo](ui/gitsync.png)](ui/gitsync.png)

[![Packagist Version](https://camo.githubusercontent.com/e2a474a55616dfc28065568a512d0859ef9084aed328a137fbc08154259fa880/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d6c756b6d616e2f67697473796e632e737667)](https://packagist.org/packages/mlukman/gitsync) [![Packagist License](https://camo.githubusercontent.com/9db43756c0b47bd84f48cfe0255863818a7ced86913c6d197f09dbf04294ac68/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6d6c756b6d616e2f67697473796e632e737667)](https://packagist.org/packages/mlukman/gitsync) [![GitHub issues](https://camo.githubusercontent.com/1fd79750984cfc6863c1e66b44418e6adc221231ae3a9610153ffc542b695e23/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f4d4c756b6d616e2f47697453796e632e7376673f6d61784167653d32353932303030)](https://github.com/MLukman/GitSync)

Introduction
============

[](#introduction)

GitSync is a PHP tool that will sync any directory on your server with a Git repository. It provides GUI for server admins to synchronize a directory with any commit (i.e. revision) of the source code with a click of a button.

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

[](#installation)

Pre-requisites
--------------

[](#pre-requisites)

1. PHP 5.4 and above running on Apache2.
2. Git already installed and added to the PATH on your machine.
3. Composer already installed and added to the PATH on your machine.

Using Git
---------

[](#using-git)

Execute the following commands:

```
mkdir /path/to/GitSync
cd /path/to/GitSync
git clone https://github.com/MLukman/GitSync .
composer install

```

Then, customize `index.php` to match your directories. Refer the section on 'Customization' below.

Using composer
--------------

[](#using-composer)

Execute the following commands:

```
mkdir /path/to/GitSync
cd /path/to/GitSync
composer require mlukman/gitsync

```

Then, either copy `index.php` from folder `vendor/mlukman/gitsync/` or create your own file using the following section on 'Customization'.

Customization
=============

[](#customization)

Basic Setup
-----------

[](#basic-setup)

At the minimum, `index.php` is the only file that you need to modify in order to customize your installation of GitSync.

First, the file must have the following file at or near the beginning of the file:

```
require __DIR__.'/vendor/autoload.php';

```

Next, you need to instantiate a `\GitSync\Config` object:

```
$config = new \GitSync\Config();

```

To add a directory to the list of directories that GitSync manages, instantiate a `\GitSync\Context` object and add it to the `$config` object using `addContext()` method:

```
$context01 = new \GitSync\Context('\path\to\directory', 'http://remote.url/repo.git', 'branchname');
$config->addContext($context01);

```

Repeat for as many directories as you want.

Finally, instantiate a `\GitSync\Application` object while passing the `$config` object and let it run.

```
$app = new \GitSync\Application($config);
$app->run();

```

That's the basic working setup.

Secure Setup
------------

[](#secure-setup)

Of course, GitSync without security is like begging to be hacked, so GitSync utilizes [Securilex](https://github.com/MLukman/Securilex) security module. Refer Securilex's [README](https://github.com/MLukman/Securilex/blob/master/README.md) for detailed usage of the module.

To enable secure mode, you just have to call `\GitSync\Application::activateSecurity` method, passing an instance of `\Securilex\DriverInterface` to the method.

### `\Securilex\Driver\SimpleDriver`

[](#securilexdriversimpledriver)

```
// create a new driver
$driver = new \Securilex\Driver\SimpleDriver();

// user with ROLE_ADMIN implicitly gets access to all contexts
$driver->addUser('admin', 'admin', array('ROLE_ADMIN'));

// user with ROLE_USER needs to be given explicit access to specific contexts
$driver->addUser('user01', 'user01', array('ROLE_USER'));

// ditto
$driver->addUser('user02', 'user02', array('ROLE_USER'));

// Add user01 & user02 to the list of user id allowed access
$context->addAllowedUid('user01')->addAllowedUid('user02');

// Activate security using the driver
$app->activateSecurity($driver);

```

### `\Securilex\Driver\LdapDriver`

[](#securilexdriverldapdriver)

Using LdapSecurityProvider is similar but you need to provide the host, port and distinguised name (DN) string:

```
// create a new driver
$driver = new \Securilex\Driver\LdapDriver("ldap.mycompany.com", 389, "uid={username},ou=People,o=MyCompany");

// No password needed when adding user to LdapSecurityProvider
$driver->addUser('JohnDoe', array('ROLE_ADMIN'));

// Activate security using the driver
$app->activateSecurity($driver);

```

### Powered by:

[](#powered-by)

[![Silex logo](ui/logo-silex.png)](http://silex.sensiolabs.org)

[![GitElephant logo](https://github.com/matteosister/GitElephant/raw/1.1.0/graphics/gitelephant_600.png)](http://gitelephant.cypresslab.net/)

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity69

Established project with proven stability

 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.

###  Release Activity

Cadence

Every ~23 days

Recently: every ~46 days

Total

30

Last Release

2980d ago

Major Versions

0.10.4 → 1.0.0-alpha2017-07-24

PHP version history (2 changes)0.1.0PHP &gt;=5.4.0

v1.x-devPHP &gt;=5.6.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/3b316248e5e09e66e72ab7e7e06eab0917dd6f937e65db3125022a6593a38a7f?d=identicon)[MLukman](/maintainers/MLukman)

---

Top Contributors

[![MLukman](https://avatars.githubusercontent.com/u/177263?v=4)](https://github.com/MLukman "MLukman (77 commits)")

---

Tags

gitsync

### Embed Badge

![Health badge](/badges/mlukman-gitsync/health.svg)

```
[![Health](https://phpackages.com/badges/mlukman-gitsync/health.svg)](https://phpackages.com/packages/mlukman-gitsync)
```

###  Alternatives

[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[craftcms/cms

Craft CMS

3.6k3.6M2.6k](/packages/craftcms-cms)[googleads/googleads-php-lib

Google Ad Manager SOAP API Client Library for PHP

67410.3M25](/packages/googleads-googleads-php-lib)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)

PHPackages © 2026

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