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

ActiveComposer-plugin

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

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

v0.1.2(9mo ago)270MITPHPPHP ^7.2.5 || ^8.0CI passing

Since Jul 8Pushed 9mo 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 1mo ago

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

29

—

LowBetter than 60% of packages

Maintenance58

Moderate activity, may be stable

Popularity11

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity33

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

299d 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 (7 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

[symfony/maker-bundle

Symfony Maker helps you create empty commands, controllers, form classes, tests and more so you can forget about writing boilerplate code.

3.4k111.1M564](/packages/symfony-maker-bundle)[liborm85/composer-vendor-cleaner

Composer Vendor Cleaner removes unnecessary development files and directories from vendor directory.

35342.7k1](/packages/liborm85-composer-vendor-cleaner)[spatie/pest-plugin-route-testing

Make sure all routes in your Laravel app are ok

13753.8k](/packages/spatie-pest-plugin-route-testing)[light/composer-ignore-plugin

ignore files by yourself

211.4k](/packages/light-composer-ignore-plugin)[opengento/composer-registration-plugin

This plugin allows to compile the Magento2 components registrations on composer install/update.

111.6k](/packages/opengento-composer-registration-plugin)

PHPackages © 2026

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