Composite package based on gitlab is identified as a submodule of git

I've made some private packages for composer at gitlab. But when my private package is required in another project, it is identified as a git submodule, so I cannot push it to the production environment.

I am following composer doc for modifying my composer.json project.
I also try Satis , but it includes the same result --- a submodule.

When I store the package on Github, it works well!

Is this a gitlab issue?
Thank!

+3


source to share


1 answer


Composer clones your packages with git instead of downloading them. When composer downloads a package from github via packagist, it downloads the file archive ( .tar.gz

) and then unpacks it into your vendor directory. When he gets your private repository he can't find the archive, so he clones it directly with git. This clone will have a directory .git

like a normal cloned repository.

The typical solution is to add a directory vendor/

to your .gitignore

. However, if you have special circumstances, you can work around this by creating your own archives using satis .

From the satis docs:



{
    "archive": {
        "directory": "dist",
        "format": "tar",
        "prefix-url": "https://amazing.cdn.example.org",
        "skip-dev": true
    }
}

      

If you do this, your packages will be archived before they are installed into the directory vendor

. There will be no directory .git

, so it will not be considered a submodule.

+1


source







All Articles