Ad

Composer Git Repository Checkout As Git-repo And Not As A Copy

- 1 answer

I've a composer based TYPO3 installation, which contains a private gitlab-repository. The private git-repository should be used as dev-master (as a real repository) so that I'm able to develope inside. But composer checks out only the master repository files, but without the .git folder.

Any clue what's wrong? In some other projects this works like expected.

My composer.json:

{
    "name": "my-vendor/my-project",
    "description" : "TYPO3 CMS Website",
    "license": "GPL-2.0-or-later",
    "minimum-stability": "dev",
    "prefer-stable": true,
    "config": {
        "platform-check": false,
        "allow-plugins": {
            "typo3/class-alias-loader": true,
            "typo3/cms-composer-installers": true,
            "captainhook/plugin-composer": true
        }
    },
    "repositories": [
        { "type": "composer", "url": "https://composer.typo3.org/" },
        { "type": "path", "url": "./packages/*" },
        { "type": "vcs", "url": "[email protected]:myvendor/typo3-amp.git" }
    ],
    "require": {
        "typo3/cms-about": "^11.0",
        "typo3/cms-backend": "^11.0",
        "typo3/cms-belog": "^11.0",
        "typo3/cms-beuser": "^11.0",
        "typo3/cms-core": "^11.0",
        "typo3/cms-dashboard": "^11.0",
        "typo3/cms-extbase": "^11.0",
        "typo3/cms-extensionmanager": "^11.0",
        "typo3/cms-felogin": "^11.0",
        "typo3/cms-filelist": "^11.0",
        "typo3/cms-fluid": "^11.0",
        "typo3/cms-fluid-styled-content": "^11.0",
        "typo3/cms-form": "^11.0",
        "typo3/cms-frontend": "^11.0",
        "typo3/cms-info": "^11.0",
        "typo3/cms-install": "^11.0",
        "typo3/cms-lowlevel": "^11.0",
        "typo3/cms-opendocs": "^11.0",
        "typo3/cms-recordlist": "^11.0",
        "typo3/cms-recycler": "^11.0",
        "typo3/cms-redirects": "^11.0",
        "typo3/cms-reports": "^11.0",
        "typo3/cms-rte-ckeditor": "^11.0",
        "typo3/cms-scheduler": "^11.0",
        "typo3/cms-seo": "^11.0",
        "typo3/cms-setup": "^11.0",
        "typo3/cms-sys-note": "^11.0",
        "typo3/cms-t3editor": "^11.0",
        "typo3/cms-tstemplate": "^11.0",
        "typo3/cms-viewpage": "^11.0",
        "helhum/typo3-console": "~7.0",
        "my-vendor/sitepackage": "@dev",
        "my-vendor/amp": "dev-master as 2.0.0",
        "ext-simplexml": "*",
        "ext-pdo": "*",
        "ext-zip": "*",
        "ext-libxml": "*",
        "ext-curl": "*",
        "ext-gd": "*",
        "ext-json": "*"
    },
    "require-dev": {
        "phpstan/phpstan": "^0.12.98",
        "saschaegerer/phpstan-typo3": "^0.13.3",
        "friendsofphp/php-cs-fixer": "^3.0",
        "captainhook/captainhook": "^5.10",
        "captainhook/plugin-composer": "^5.3",
        "rector/rector": "0.11.53"
    },
    "extra": {
        "captainhook": {
            "force-install": true
        }
    },
    "scripts": {
        "php-cs-fixer": "vendor/bin/php-cs-fixer fix packages",
        "phpstan": "vendor/bin/phpstan analyse",
        "rector": "vendor/bin/rector process packages",
        "ci": [
            "@php-cs-fixer",
            "@phpstan",
            "@rector"
        ]
    }
}
Ad

Answer

Let's have a look in the manual:

If you set the no-api key to true on a github repository it will clone the repository as it would with any other git repository instead of using the GitHub API. But unlike using the git driver directly, Composer will still attempt to use github's zip files.

The simple trick seems to be not to use the vcs driver but instead the git driver for the private repo...

Ad
source: stackoverflow.com
Ad