PHPackages                             codex/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. [API Development](/categories/api)
4. /
5. codex/git

ActiveCodex-addon[API Development](/categories/api)

codex/git
=========

Codex Addon - Enables Github/Bitbucket integration &amp; synchronisation (auto-webhook or manual) based on tags/branches.

0335PHP

Since Apr 27Pushed 7y ago1 watchersCompare

[ Source](https://github.com/codex-project/git)[ Packagist](https://packagist.org/packages/codex/git)[ RSS](/packages/codex-git/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

   title Git   subtitle Addons  Git
===

[](#git)

The git addon allows your Codex project to fetch documentation from any bitbucket/github repository. Either by manual synchronisation or automated synchronisation using webhooks.

Lets say you have a repository on github with a directory named `docs`, containing all your documentation. The git addon has the ability to sync your repository's branches/tags to your local project's revisions. It's even possible to create a github webhook to your Codex project, making Codex automatically synchronise the latest changes.

### Installation

[](#installation)

```
composer require codex/git
php artisan codex:addon enable codex/git
php artisan vendor:publish --provider="Codex\Git\GitAddonServiceProvider"
```

### Project Configuration

[](#project-configuration)

You can add the git addon configuration to your project's `config.php`.

```
[
    // ...
    'git'       => [
        'remotes' => [
            'main' => [
                // The connection key to use (as defined at the top of this file)
                'connection' => '',
                // The owner (organisation or username)
                'owner'      => '',
                // The repository name
                'repository' => '',
                // repository url
                'url'        => 'https://bitbucket.org/%s/%s',

                'document_url' => 'https://bitbucket.org/%s/%s/src/%s',

                'webhook' => [
                    // Enable webhook support. Configure it in Github/Bitbucket.
                    // This will automaticly sync your project every time a 'push' event occurs
                    // This also requires you to configure queues properly (by using for example, redis with supervisord)
                    'enabled' => false,

                    // Github webhooks allow a 'secret' that has to match. Put it in here
                    'secret'  => null,
                ],
            ],
        ],
        'syncs'   => [
            [
                'remote'   => 'main',
                // Branches to sync
                'branches' => [], //[ 'master']
                // Version (tags) constraints makes one able to define ranges and whatnot
                // * || 1.x || >=2.5.0 || 5.0.0 - 7.2.3'
                'versions' => null,

                'skip' => [
                    'patch_versions' => false,
                    'minor_versions' => false,
                ],

                'clean' => [

                ],

                'copy' => [
                    'docs',
                    'docs/ ** /*.md',
                    'docs/index.md' => 'index.md',
                    'README.md'     => 'index.md',
                ],
            ],
        ],
        'links'   => [
            'enabled' => false,
            'remote'  => 'main',
            'map'     => [
                'edit_page' => 'layout.toolbar.right', // push attribute to array (default)
            ],
            'links'   => [
                'edit_page' => [
                    'component'  => 'c-button',
                    'borderless' => true,
                    'target'     => '_black',
                    'type'       => 'toolbar',
                    /** git.connection_config is a get modifier in Document @see \Codex\Git\GitAddonServiceProvider */
//                        'icon'       => '%remote.connection.driver%',
                    'children'   => 'Edit Page',
                    /** git_links.document_url is a get modifier in Document @see \Codex\Git\GitAddonServiceProvider */
//                        'href'       => '%remote.document_url%',
                ],
            ],
        ],
    ],
];
```

### Global Configuration

[](#global-configuration)

Located in `config/codex-git.php`

```
return [
    'connections'            => [
        'bitbucket_oauth'    => [
            'driver' => 'bitbucket',
            'method' => 'oauth',
            'key'    => env('CODEX_GIT_BITBUCKET_KEY', 'your-key'),
            'secret' => env('CODEX_GIT_BITBUCKET_SECRET', 'your-secret'),
        ],
        'bitbucket_password' => [
            'driver'   => 'bitbucket',
            'method'   => 'password',
            'username' => env('CODEX_GIT_BITBUCKET_USERNAME', 'your-username'),
            'password' => env('CODEX_GIT_BITBUCKET_PASSWORD', 'your-password'),
        ],
        'github_token'       => [
            'driver' => 'github',
            'method' => 'token',
            'token'  => env('CODEX_GIT_GITHUB_TOKEN', 'your-token'),
        ],
        'github_password'    => [
            'driver'   => 'github',
            'method'   => 'password',
            'username' => env('CODEX_GIT_GITHUB_USERNAME', 'your-username'),
            'password' => env('CODEX_GIT_GITHUB_PASSWORD', 'your-password'),
        ],
        'github_app'         => [
            'driver'       => 'github',
            'clientId'     => 'your-client-id',
            'clientSecret' => 'your-client-secret',
            'method'       => 'application',
        ],
        'github_jwt'         => [
            'driver' => 'github',
            'token'  => 'your-jwt-token',
            'method' => 'jwt',
        ],
    ],
    // ...
];
```

### Synchronising

[](#synchronising)

#### Manual synchronisation

[](#manual-synchronisation)

```
php artisan codex:git:sync [project]
```

#### Automatic (webhook) synchronisation

[](#automatic-webhook-synchronisation)

To use automatic synchronisation:

- Automatic synchronisation depends on a working laravel queue driver. Make sure you have it configured and running.
- You need to add a webhook to your github/bitbucket repository. The webhook url should be equal to the `codex.git.webhook.{bitbucket,github}` route url. Use `php artisan route:list` to get it.

Copyright/License
-----------------

[](#copyrightlicense)

Copyright 2019 [Robin Radic](https://github.com/RobinRadic) - [MIT Licensed](LICENSE.md)

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

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://www.gravatar.com/avatar/303828383a9c2bf382436a61f4471425428b28c095c6df9a9714444cbc163538?d=identicon)[radic](/maintainers/radic)

### Embed Badge

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

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

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

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