PHPackages                             mborne/remote-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. mborne/remote-git

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

mborne/remote-git
=================

A lightweight PHP client providing a consistent way to find hosted and self-hosted git repositories (github, gitlab,...)

v0.11.1(3mo ago)28.2k↑38.5%2[2 issues](https://github.com/mborne/remote-git/issues)MITPHPPHP &gt;=8.3CI passing

Since Nov 25Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/mborne/remote-git)[ Packagist](https://packagist.org/packages/mborne/remote-git)[ RSS](/packages/mborne-remote-git/feed)WikiDiscussions master Synced yesterday

READMEChangelog (3)Dependencies (16)Versions (21)Used By (0)

mborne/remote-git
=================

[](#mborneremote-git)

[![CI](https://github.com/mborne/remote-git/actions/workflows/ci.yml/badge.svg)](https://github.com/mborne/remote-git/actions/workflows/ci.yml) [![Coverage Status](https://camo.githubusercontent.com/eeced2156069c49e8ed23f6067ff7f78c4fb385858a71af5541fdbea76d4ae17/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6d626f726e652f72656d6f74652d6769742f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/mborne/remote-git?branch=master)

Description
-----------

[](#description)

A lightweight PHP client providing a consistent access to hosted and self-hosted git repositories (github, gitlab, gogs and gitea).

Use cases
---------

[](#use-cases)

- The original development has been realized in [mborne/satis-gitlab](https://github.com/mborne/satis-gitlab) repository to **generate a config file referencing git repositories**.
- This module is also used by [mborne/git-manager](https://github.com/mborne/git-manager#git-manager) to **backup and analyse git repositories** (for example that following files are present : README.md, LICENSE,...)

Features
--------

[](#features)

- List repositories from multiple GIT hosting services filtering by
    - usernames
    - organizations/groups
- Get raw files from repositories
- Apply custom filter
    - Project contains a given file (`RequiredFileFilter`)
    - Project is a composer project (`ComposerProjectFilter`)
    - Project name doesn't match a given regexp (`IgnoreRegexpFilter`)

Requirements
------------

[](#requirements)

- [PHP &gt;= 8.3](https://www.php.net/supported-versions.php)
- Supported GIT hosting services :

TypeDescriptiongitlab-v4[gitlab.com](https://about.gitlab.com/) and self hosted gitlab instancesgithub[github.com](https://github.com)gogs-v1[Gogs](https://gogs.io/) or [Gitea](https://gitea.io/)Usage
-----

[](#usage)

### Create a client

[](#create-a-client)

```
// configure client
$clientOptions = new ClientOptions();
$clientOptions
    ->setUrl('https://github.com')
    ->setToken($token)
;

// create client
$client = ClientFactory::createClient(
    $clientOptions,
    new NullLogger()
);
```

### Filter by usernames or orgs/groups

[](#filter-by-usernames-or-orgsgroups)

```
$options = new FindOptions();
// Use '_me_' on github to include private repositories
$options->setUsers(array('mborne'));
$options->setOrganizations(array('symfony','FriendsOfSymfony'));
$projects = $client->find($options);
```

### Filter according to composer.json

[](#filter-according-to-composerjson)

```
$options = new FindOptions();
$options->setUsers(array('mborne'));
$filter = new ComposerProjectFilter($client);
$filter->setType('library');
$options->setFilter($filter);
$projects = $client->find($options);
```

### Compose filters

[](#compose-filters)

```
$options = new FindOptions();
$options->setUsers(array('mborne'));

$filterCollection = new FilterCollection();

// filter according to composer.json
$composerFilter = new ComposerProjectFilter($client);
$composerFilter->setType('library');
$filterCollection->addFilter($composerFilter);

// filter according to README.md
$filterCollection->addFilter(new RequiredFileFilter(
    $client,
    'README.md'
));

$options->setFilter($filterCollection);
$projects = $client->find($options);
```

Dependencies
------------

[](#dependencies)

- [guzzlehttp/guzzle - 7.x](https://packagist.org/packages/guzzlehttp/guzzle)
- [psr/log](https://packagist.org/packages/psr/log)

License
-------

[](#license)

[MIT](LICENSE)

Testing
-------

[](#testing)

- Configure access token for github.com and gitlab.com APIs (optional) :

```
# see https://github.com/settings/tokens
export GITHUB_TOKEN=AnyGithubToken
# see https://gitlab.com/-/profile/personal_access_tokens
export GITLAB_TOKEN=AnyGitlabToken
# see https://gitea.com/user/settings/applications
export GITEA_TOKEN=AnyGiteaToken
```

- Install dependencies and run tests :

```
make test
# Alternative :
# composer install
# vendor/bin/phpunit -c phpunit.xml.dist
```

Note that an HTML coverage report is generated to `output/coverage/index.html`

###  Health Score

48

—

FairBetter than 93% of packages

Maintenance61

Regular maintenance activity

Popularity28

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity76

Established project with proven stability

 Bus Factor1

Top contributor holds 98.4% 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 ~167 days

Recently: every ~30 days

Total

17

Last Release

98d ago

PHP version history (2 changes)v0.6.0PHP &gt;=8.1

v0.9.1PHP &gt;=8.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1783064?v=4)[MBorne](/maintainers/mborne)[@mborne](https://github.com/mborne)

---

Top Contributors

[![mborne](https://avatars.githubusercontent.com/u/1783064?v=4)](https://github.com/mborne "mborne (126 commits)")[![golgote](https://avatars.githubusercontent.com/u/12360?v=4)](https://github.com/golgote "golgote (2 commits)")

---

Tags

clientclient-librarygitgiteagithubgitlabgogsphp

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/mborne-remote-git/health.svg)

```
[![Health](https://phpackages.com/badges/mborne-remote-git/health.svg)](https://phpackages.com/packages/mborne-remote-git)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.8k543.8M20.1k](/packages/laravel-framework)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[grumpydictator/firefly-iii

Firefly III: a personal finances manager.

23.9k69.5k](/packages/grumpydictator-firefly-iii)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

751291.4k43](/packages/civicrm-civicrm-core)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

21866.0M1.7k](/packages/drupal-core)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6942.5M421](/packages/drupal-core-recommended)

PHPackages © 2026

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