Composer is cloning your packages with git instead of downloading them. When composer downloads a package from github via packagist, it downloads an archive of the file (.tar.gz
), then uncompresses it into your vendor directory. When it gets your private repository, it can't find an archive, so it clones it directly with git. This clone will have a .git
directory, just like a normal cloned repository.
The typical solution is to add the vendor/
directory to your .gitignore
. However, if you have special circumstances, you can get around this by creating your own archives with 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 in the vendor
directory. There will be no .git
directory, so it won't be treated as a submodule.