Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please exclude the .git folder from the composer builds #171

Open
jandrews377 opened this issue Jun 13, 2019 · 3 comments
Open

Please exclude the .git folder from the composer builds #171

jandrews377 opened this issue Jun 13, 2019 · 3 comments

Comments

@jandrews377
Copy link

Hi there. Can you please exclude your .git folder from the composer build. I am (not ideally) including my vendors folder in my git source control and the .git folder in the composer install is clashing. Also, I am eagerly awaiting an undated release, there are changes on you dev-master that I am leaning on in production :) really appreciate your hard work.

@garrettw
Copy link

garrettw commented Jun 13, 2019

I don't think there's a way to do that. When Composer pulls down packages from Packagist, it's cloning Git repos. That will always come with a .git folder. So I think it would be better for you to fix your project structure to not include your vendor folder in the committed code.
If you want to commit specific versions of dependencies to your repo, just commit your composer.lock file. Then when you run composer install, it will not recalculate all the dependency versions but instead just grab whatever is specified in the lock file.

@TRPB
Copy link
Member

TRPB commented Jun 13, 2019

I'm also not sure this is possible due to the way composer works. If it is, I'm happy to accept a PR that does this as it seems rather inefficient if composer holds the entire project history for every package it downloads.

@adrian-green
Copy link

adrian-green commented Nov 25, 2020

This is a user-end setting.
See https://getcomposer.org/doc/06-config.md#preferred-install

In your composer.json define how you wish dependencies to install as one of "source", "dist" or "auto" (default).

   "config": {
      "preferred-install":  {
         "level-2/*" : "dist"
      }
   }

If you were to examine the "packages" element of the composer.lock you'll find something like the following. (Note the "type": "zip" under "dist"):

"packages": [
    {
        "name": "level-2/dice",
        "version": "dev-master",
        "source": {
            "type": "git",
            "url": "https://github.com/Level-2/Dice.git",
            "reference": "cbcc42205b8ce9fcd04b9fa60fc3da409c7d3fea"
        },
        "dist": {
            "type": "zip",
            "url": "https://api.github.com/repos/Level-2/Dice/zipball/cbcc42205b8ce9fcd04b9fa60fc3da409c7d3fea",
            "reference": "cbcc42205b8ce9fcd04b9fa60fc3da409c7d3fea",
            "shasum": ""
        },...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants