PHPackages                             contao-community-alliance/build-system-repository-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. contao-community-alliance/build-system-repository-git

Abandoned → [bit3/git-php](/?search=bit3%2Fgit-php)ArchivedLibrary

contao-community-alliance/build-system-repository-git
=====================================================

GIT repository for CCABS.

07.9k5PHP

Since Sep 19Pushed 11y ago2 watchersCompare

[ Source](https://github.com/contao-community-alliance-archive/build-system-repository-git)[ Packagist](https://packagist.org/packages/contao-community-alliance/build-system-repository-git)[ RSS](/packages/contao-community-alliance-build-system-repository-git/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (5)

GIT repository
==============

[](#git-repository)

[![Build Status](https://camo.githubusercontent.com/908aab759a7557d2176de33721320668166a3087cbd3485944ce7d760f12c627/68747470733a2f2f7472617669732d63692e6f72672f636f6e74616f2d636f6d6d756e6974792d616c6c69616e63652f6275696c642d73797374656d2d7265706f7369746f72792d6769742e706e67)](https://travis-ci.org/contao-community-alliance/build-system-repository-git)

This is a lightweight git adapter, providing the git commands in PHP.

Usage examples
--------------

[](#usage-examples)

The API use command builders, that allow you to build a command and execute it one time.

The main synopsis is:

```
$git->command()->option()->execute();
```

`$git->command()` will create a new command, `*->option()` will add an option to the command and `*->execute()` will finally execute the command.

The naming of commands and options follow the git naming. If you search for documentation of a specific command or option, just look into the git documentation. You will find the command/option there.

#### init a new git repository

[](#init-a-new-git-repository)

```
use ContaoCommunityAlliance\BuildSystem\Repository\GitRepository;

$directory = '/path/to/git/target/directory';

$git = new GitRepository($directory);
$git->init()->execute();
```

#### clone a git repository

[](#clone-a-git-repository)

The `clone` command is named `cloneRepository()` because `clone` is a reserved word in PHP.

```
use ContaoCommunityAlliance\BuildSystem\Repository\GitRepository;

$directory = '/path/to/git/target/directory';

$git = new GitRepository($directory);
$git->cloneRepository()->execute();
```

#### describe

[](#describe)

```
$annotatedTag   = $git->describe()->execute();
$lightweightTag = $git->describe()->tags()->execute();
$recentRef      = $git->describe()->all()->execute();
```

#### set remote fetch url

[](#set-remote-fetch-url)

```
$git->remote()
	->setUrl('origin', 'git@github.com:contao-community-alliance/build-system-repository-git.git')
	->execute();
```

#### set remote push url

[](#set-remote-push-url)

```
$git->remote()
	->setPushUrl('origin', 'git@github.com:contao-community-alliance/build-system-repository-git.git')
	->execute();
```

#### add new remote

[](#add-new-remote)

```
$git->remote()
	->add('github', 'git@github.com:contao-community-alliance/build-system-repository-git.git')
	->execute();
```

#### fetch remote objects

[](#fetch-remote-objects)

```
$git->fetch()->execute('github');
```

#### checkout

[](#checkout)

```
$git->checkout()->execute('hotfix/1.2.3');
```

#### checkout specific path

[](#checkout-specific-path)

```
$git->checkout()->execute('hotfix/1.2.3', '/fileA', '/fileB', '/dir/fileC');
```

#### push objects

[](#push-objects)

```
$git->push()->execute('github', 'hotfix/1.2.3');
```

#### add file to staging index

[](#add-file-to-staging-index)

```
$git->add()->execute('file/to/add.ext');
```

#### remove file

[](#remove-file)

```
$git->rm()->execute('file/to/remove.ext');
```

#### commit changes

[](#commit-changes)

```
$git->commit()->message('Commit message')->execute();
```

#### create a tag

[](#create-a-tag)

```
$git->tag()->execute('v1.2.3');
```

### Convenience and shortcut methods

[](#convenience-and-shortcut-methods)

#### list remotes

[](#list-remotes)

```
$remotes = $git->remote()->getNames();

// array(
//     'origin',
//     'composer',
// )
```

#### list branches

[](#list-branches)

```
$remotes = $git->branch()->getNames();

// array(
//     'master',
//     'hotfix/1.2.3',
// )
```

#### list remote tracking branches

[](#list-remote-tracking-branches)

```
$remotes = $git->branch()->remotes()->->getNames();

// array(
//     'origin/master',
//     'origin/hotfix/1.2.3',
//     'origin/release/4.5.6',
// )
```

#### list branches including remote tracking branches

[](#list-branches-including-remote-tracking-branches)

```
$remotes = $git->branch()->all()->->getNames();

// array(
//     'master',
//     'hotfix/1.2.3',
//     'remotes/origin/master',
//     'remotes/origin/hotfix/1.2.3',
//     'remotes/origin/release/4.5.6',
// )
```

#### get modification status

[](#get-modification-status)

```
$status = $git->status()->getStatus();

// array(
//     'existing-file.txt'      => array('index' => 'D',   'worktree' => false),
//     'removed-but-staged.txt' => array('index' => 'D',   'worktree' => 'A'),
//     'staged-file.txt'        => array('index' => false, 'worktree' => 'A'),
//     'unknown-file.txt'       => array('index' => '?',   'worktree' => '?'),
// )
```

#### get index modification status

[](#get-index-modification-status)

```
$status = $git->status()->getIndexStatus();

// array(
//     'existing-file.txt'      => 'D',
//     'removed-but-staged.txt' => 'D',
//     'staged-file.txt'        => false,
//     'unknown-file.txt'       => '?',
// )
```

#### get worktree modification status

[](#get-worktree-modification-status)

```
$status = $git->status()->getWorkTreeStatus();

// array(
//     'existing-file.txt'      => 'worktree' => false,
//     'removed-but-staged.txt' => 'worktree' => 'A',
//     'staged-file.txt'        => 'worktree' => 'A',
//     'unknown-file.txt'       => 'worktree' => '?',
// )
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community14

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://avatars.githubusercontent.com/u/8672569?v=4)[California College of Arts](/maintainers/cca)[@cca](https://github.com/cca)

---

Top Contributors

[![tristanlins](https://avatars.githubusercontent.com/u/343404?v=4)](https://github.com/tristanlins "tristanlins (60 commits)")

### Embed Badge

![Health badge](/badges/contao-community-alliance-build-system-repository-git/health.svg)

```
[![Health](https://phpackages.com/badges/contao-community-alliance-build-system-repository-git/health.svg)](https://phpackages.com/packages/contao-community-alliance-build-system-repository-git)
```

PHPackages © 2026

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