PHPackages                             sunaoka/composer-vcs-export-plugin - 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. sunaoka/composer-vcs-export-plugin

ActiveComposer-plugin[Utility &amp; Helpers](/categories/utility)

sunaoka/composer-vcs-export-plugin
==================================

Exports Composer VCS repositories to vendor directories applying .gitattributes export-ignore rules.

v0.1.2(11mo ago)386MITPHPPHP ^7.2.5 || ^8.0CI passing

Since Jul 8Pushed 4w agoCompare

[ Source](https://github.com/sunaoka/composer-vcs-export-plugin)[ Packagist](https://packagist.org/packages/sunaoka/composer-vcs-export-plugin)[ RSS](/packages/sunaoka-composer-vcs-export-plugin/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (5)Versions (4)Used By (0)

Composer VCS Export Plugin
==========================

[](#composer-vcs-export-plugin)

[![Latest](https://camo.githubusercontent.com/fa47d28553a421c5d166bea8c7b99ae57cbf77a12d7db43f8a8f129f4c125780/68747470733a2f2f706f7365722e707567782e6f72672f73756e616f6b612f636f6d706f7365722d7663732d6578706f72742d706c7567696e2f76)](https://packagist.org/packages/sunaoka/composer-vcs-export-plugin)[![License](https://camo.githubusercontent.com/446901cd0923a1761aee71359c5726db161fbaa12636b9e337190112f0ddc778/68747470733a2f2f706f7365722e707567782e6f72672f73756e616f6b612f636f6d706f7365722d7663732d6578706f72742d706c7567696e2f6c6963656e7365)](https://packagist.org/packages/sunaoka/composer-vcs-export-plugin)[![PHP](https://camo.githubusercontent.com/961deeff25c987e23191901db5e8d813ae2d43ec39abeac777c4722d5125030c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f73756e616f6b612f636f6d706f7365722d7663732d6578706f72742d706c7567696e)](composer.json)[![Test](https://github.com/sunaoka/composer-vcs-export-plugin/actions/workflows/test.yml/badge.svg)](https://github.com/sunaoka/composer-vcs-export-plugin/actions/workflows/test.yml)[![codecov](https://camo.githubusercontent.com/dbed99644bb1948e33ac7099fd8e04549aaa3db1c8e905b18a525d3d696d7854/68747470733a2f2f636f6465636f762e696f2f6769746875622f73756e616f6b612f636f6d706f7365722d7663732d6578706f72742d706c7567696e2f67726170682f62616467652e737667)](https://codecov.io/github/sunaoka/composer-vcs-export-plugin)

Overview
--------

[](#overview)

This Composer plugin ensures that when installing packages from VCS repositories (such as Git) via the `repositories` configuration, only the files allowed by `.gitattributes` `export-ignore` rules are placed in the `vendor` directory.
It enables clean, distribution-like installs even when directly referencing VCS sources, helping maintain a tidy `vendor/` with only the intended files from each package.

Features
--------

[](#features)

- Applies `.gitattributes` `export-ignore` rules to packages installed from VCS repositories
- Ensures only distribution-ready files are present in `vendor/`
- Works automatically during Composer install/update
- No configuration required for standard usage

Installation
------------

[](#installation)

Add the plugin to your project using Composer:

```
composer require --dev sunaoka/composer-vcs-export-plugin
```

Or

```
composer global require sunaoka/composer-vcs-export-plugin
```

Usage
-----

[](#usage)

No additional configuration is needed.
When you install or update packages from VCS repositories (e.g., via the `repositories` section in your `composer.json`), this plugin will:

- Detect if the package was installed from a Git repository
- Use `git archive` to export files, respecting `.gitattributes` `export-ignore` rules
- Replace the package directory in `vendor/` with the exported contents

Example
-------

[](#example)

**composer.json:**

```
{
    "repositories": [
        {
            "type": "vcs",
            "url": "https://example.com/your-vendor/your-library.git"
        }
    ],
    "require": {
        "your-vendor/your-library": "^1.0",
        "sunaoka/composer-vcs-export-plugin": "^1.0"
    },
    "config": {
        "allow-plugins": {
          "sunaoka/composer-vcs-export-plugin": true
        }
    }
}
```

With this setup, only the files not marked with `export-ignore` in `.gitattributes` will be present in `vendor/your-vendor/your-library`.

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

[](#requirements)

- PHP 7.2.5 or later
- Composer 2.x
- `git` and `unzip` command available in the system environment

Limitations
-----------

[](#limitations)

- Only works with Git repositories
- Requires the `.git` directory to be present in the installed package (i.e., VCS install, not dist)
- May not work on environments where `git archive` or `unzip` are unavailable (e.g., some Windows setups)
- Does not affect packages installed via dist (zip/tarball)

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance75

Regular maintenance activity

Popularity13

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity34

Early-stage or recently created project

 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 ~3 days

Total

3

Last Release

355d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/aab0eef8c17cb4a1d856c457224642bdf29adf5255e2f9db84e1c192f78ef272?d=identicon)[sunaoka](/maintainers/sunaoka)

---

Top Contributors

[![sunaoka](https://avatars.githubusercontent.com/u/105845?v=4)](https://github.com/sunaoka "sunaoka (8 commits)")

---

Tags

composer-plugingitattributesphpvcsphpplugincomposerdevrepositories.gitattributesvcsexport-ignore

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sunaoka-composer-vcs-export-plugin/health.svg)

```
[![Health](https://phpackages.com/badges/sunaoka-composer-vcs-export-plugin/health.svg)](https://phpackages.com/packages/sunaoka-composer-vcs-export-plugin)
```

###  Alternatives

[composer/composer

Composer helps you declare, manage and install dependencies of PHP projects. It ensures you have the right stack everywhere.

29.5k196.2M3.1k](/packages/composer-composer)[friendsofphp/php-cs-fixer

A tool to automatically fix PHP code style

13.5k251.2M25.2k](/packages/friendsofphp-php-cs-fixer)[phpro/grumphp

A composer plugin that enables source code quality checks.

4.3k16.7M1.0k](/packages/phpro-grumphp)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[civicrm/civicrm-core

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

751291.4k43](/packages/civicrm-civicrm-core)[oro/platform

Business Application Platform (BAP)

645143.5k115](/packages/oro-platform)

PHPackages © 2026

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