PHPackages                             shadiakiki1986/git-data-repo - 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. [File &amp; Storage](/categories/file-storage)
4. /
5. shadiakiki1986/git-data-repo

ActiveLibrary[File &amp; Storage](/categories/file-storage)

shadiakiki1986/git-data-repo
============================

Manage saving/loading data from php to a git data repository

0.1.1(9y ago)0267PHP

Since Sep 20Pushed 9y ago1 watchersCompare

[ Source](https://github.com/shadiakiki1986/git-data-repo)[ Packagist](https://packagist.org/packages/shadiakiki1986/git-data-repo)[ RSS](/packages/shadiakiki1986-git-data-repo/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (7)Versions (3)Used By (0)

git-data-repo
=============

[](#git-data-repo)

PHP library to manage the storage of key-value pairs in a git repository.

Packagist: [![Latest Stable Version](https://camo.githubusercontent.com/ec54942bf83dcd297c0eaa00d2e3dad64b12b295cdc7b03986b61eb64d0fc0ef/68747470733a2f2f706f7365722e707567782e6f72672f7368616469616b696b69313938362f6769742d646174612d7265706f2f76657273696f6e)](https://packagist.org/packages/shadiakiki1986/git-data-repo)[![Total Downloads](https://camo.githubusercontent.com/b94c41d964635b11ae47b58db65f72f6cb47175b4a7b44984e31daaef8948ceb/68747470733a2f2f706f7365722e707567782e6f72672f7368616469616b696b69313938362f6769742d646174612d7265706f2f646f776e6c6f616473)](https://packagist.org/packages/shadiakiki1986/git-data-repo)[![Latest Unstable Version](https://camo.githubusercontent.com/cbc6661272e2ab4d97e0bc04c298c738258c145721c1e069d205766be2e8b572/68747470733a2f2f706f7365722e707567782e6f72672f7368616469616b696b69313938362f6769742d646174612d7265706f2f762f756e737461626c65)](//packagist.org/packages/shadiakiki1986/git-data-repo)[![License](https://camo.githubusercontent.com/d94f487304e2a70bada8a6a6b2eb27d412d886da95aee5681bc7d523ed4309ea/68747470733a2f2f706f7365722e707567782e6f72672f7368616469616b696b69313938362f6769742d646174612d7265706f2f6c6963656e7365)](https://packagist.org/packages/shadiakiki1986/git-data-repo)[![Monthly Downloads](https://camo.githubusercontent.com/b7dd3aa802f8d4d33f0e0a1e4b2fc20f62d8196a74ca030888b349d8b21eba54/68747470733a2f2f706f7365722e707567782e6f72672f7368616469616b696b69313938362f6769742d646174612d7265706f2f642f6d6f6e74686c79)](https://packagist.org/packages/shadiakiki1986/git-data-repo)[![Daily Downloads](https://camo.githubusercontent.com/73c82193b3b5b9f51f31fc6542cf6b625e061203f55217c3d23c0f345b7027ca/68747470733a2f2f706f7365722e707567782e6f72672f7368616469616b696b69313938362f6769742d646174612d7265706f2f642f6461696c79)](https://packagist.org/packages/shadiakiki1986/git-data-repo)[![composer.lock available](https://camo.githubusercontent.com/06c9ea5173fcce77be9a4b862e9137f214a42f7ab360eb77a2f8ff87209441d3/68747470733a2f2f706f7365722e707567782e6f72672f7368616469616b696b69313938362f6769742d646174612d7265706f2f636f6d706f7365726c6f636b)](https://packagist.org/packages/shadiakiki1986/git-data-repo)

Travis CI: [![Build Status](https://camo.githubusercontent.com/c6a1a827f81a27118cfc7d4f917103d93ce5efd262b3bd655023f1380b701e22/68747470733a2f2f7472617669732d63692e6f72672f7368616469616b696b69313938362f6769742d646174612d7265706f2e7376673f6272616e63683d6d6173746572)](http://travis-ci.org/shadiakiki1986/git-data-repo)

Code Climate: [![Code Climate](https://camo.githubusercontent.com/8518a17311a3fa99c7b6a1d8c755fd9de344a70335848d4a893963d4586ae32e/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f7368616469616b696b69313938362f6769742d646174612d7265706f2f6261646765732f6770612e737667)](https://codeclimate.com/github/shadiakiki1986/git-data-repo)[![Test Coverage](https://camo.githubusercontent.com/d5a7ef140f263a7deafabed037cd46cc869604a5cb9106f2bf30daeb628e837f/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f7368616469616b696b69313938362f6769742d646174612d7265706f2f6261646765732f636f7665726167652e737667)](https://codeclimate.com/github/shadiakiki1986/git-data-repo/coverage)[![Issue Count](https://camo.githubusercontent.com/679236f6fef4b3e0f9076c8707252f99a130ce2c9a64033b4944f1b1227e1383/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f7368616469616b696b69313938362f6769742d646174612d7265706f2f6261646765732f69737375655f636f756e742e737667)](https://codeclimate.com/github/shadiakiki1986/git-data-repo)

DEPRECATED
==========

[](#deprecated)

I notice often that the chown in composer.json post-install is a problem when I use the code from web with www-data user or from shell in docker with root user. This brings up the need for a separate server that is running with its own "stable" filesystem and file permissions. These would at least be independent of developments in the `git-data-repo` library, as well as `composer install` or `composer update` or whatever.

[This](http://stackoverflow.com/a/20023103/4126114) SO answer proposes [Orion Git API](http://wiki.eclipse.org/Orion/Server_API/Git_API), which unfortunately is not open-source. Another answer on the same SO question noted that [korya/node-git-rest-api](https://github.com/korya/node-git-rest-api) was incomplete, but it met all my requirements for the server-side:

- can clone private repositories by accepting credentials
- can fetch the contents of a particular file
- can stage a new file, commit it, and push the commit
- can stage modifications to an existing file, commit, and push
- should be dockerifiable (what isnt)

About the class `TempFolder`, I found that it is replaceable by

About the class `GitDataRepo`, it is replaced by the following server-client architecture

- server:
- client:
- flysystem-git adapter:

Check the flysystem-git adapter repo for usage

Installing
==========

[](#installing)

`composer install`

Usage
=====

[](#usage)

Check [tests/GitDataRepoTest.php](tests/GitDataRepoTest.php)

Testing Using SSH keys
======================

[](#testing-using-ssh-keys)

1. Create a repository on github/bitbucket/etc.
2. initialize it

```
mkdir /path/to/your/project
cd /path/to/your/project
git init
git remote add origin https://shadiakiki1986@bitbucket.org/shadiakiki1986/ffa-bdlreports-maps.git
```

2. make first commit echo "shadiakiki1986" &gt;&gt; contributors.txt git add contributors.txt git commit -m 'Initial commit with contributors' git push -u origin master

```
2. Generate ssh keys: `ssh-keygen -t rsa -b 4096 -C "shadiakiki1986@gmail.com"`
6. Copy public key to deploy keys setting of repository on github
5. Configure ssh keys
```bash
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa
cat ~/.ssh/id_rsa.pub

```

7. Run tests

```
export GITDATAREPO_REMOTE=git@github.com:shadiakiki1986/git-data-repo-testDataRepo
composer run-script test
```

Testing Using github credentials
================================

[](#testing-using-github-credentials)

1. Create a repository on github
2. Run tests

```
export GITDATAREPO_REMOTE=https://shadiakiki1986:veggiepizza@github.com/shadiakiki1986/git-data-repo-testDataRepo
composer run-script test
```

Note on bitbucket
=================

[](#note-on-bitbucket)

For bitbucket repos, one needs

```
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
# Omit --global to set the identity only in this repository
```

Developer notes
===============

[](#developer-notes)

travis with ssh keys
--------------------

[](#travis-with-ssh-keys)

1. Follow section above on `testing using ssh keys`
2. Encrypt `~/.ssh/id_rsa` and `~/.ssh/id_rsa.pub` using [travis CLI](https://docs.travis-ci.com/user/encrypting-files/#Encrypting-multiple-files)

- Note the need to tar the public and private keys because `travis encrypt-file` cannot encrypt more than one file

```
travis login # enter github credentials
tar cvf ssh_keys.tar -C ~/.ssh id_rsa id_rsa.pub
travis encrypt-file ssh_keys.tar --add
git add ssh_keys.tar.enc
```

References

-
-
-
-

phpmd
-----

[](#phpmd)

`phpmd` issued warnings about static access to classes. I disabled these warnings for the functions in subject. To see them, check `grep SuppressWarnings * -r --exclude-dir=vendor`

phpcs
-----

[](#phpcs)

If `phpcs` reports errors that can be fixed automatically, run `vendor/bin/phpcbf src/` and then commit the changes

badges
------

[](#badges)

Badges from [badge poser](https://poser.pugx.org/show/shadiakiki1986/git-data-repo#badges)

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

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.

###  Release Activity

Cadence

Every ~35 days

Total

2

Last Release

3534d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2cc997a8672e96aaee90c8555b7e5bc9693894e74c7530abf2216ee6799357ff?d=identicon)[shadiakiki1986](/maintainers/shadiakiki1986)

---

Top Contributors

[![shadiakiki1986](https://avatars.githubusercontent.com/u/8392324?v=4)](https://github.com/shadiakiki1986 "shadiakiki1986 (63 commits)")

---

Tags

datagitrepositorydata-repository

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/shadiakiki1986-git-data-repo/health.svg)

```
[![Health](https://phpackages.com/badges/shadiakiki1986-git-data-repo/health.svg)](https://phpackages.com/packages/shadiakiki1986-git-data-repo)
```

###  Alternatives

[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.6k38.2k](/packages/matomo-matomo)[google/cloud

Google Cloud Client Library

1.2k16.5M57](/packages/google-cloud)[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k12](/packages/tempest-framework)

PHPackages © 2026

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