How to make composer NOT create a .git directory for a package

前端 未结 3 2033
挽巷
挽巷 2021-01-03 21:46

I found a couple related posts, but those don\'t really answer my question. Let\'s say I want to install this package: https://github.com/pear/Net_Socket

an excerpt

3条回答
  •  不知归路
    2021-01-03 22:36

    If a package is seen as a git submodule, you haven't excluded the vendor folder from being committed to your own repository. It is recommended to add the vendor folder to .gitignore, and not commit these files, only commit composer.lock (and composer.json of course).

    Apart from that, running composer install --prefer-dist should do the job. Note that Composer seems to not change the download method used first if you change your mind later. If Composer detects a cloned repo, it is faster to just update that instead of downloading a ZIP and unpacking it. If you want to change that, delete the whole vendor folder and run composer update --prefer-dist.

提交回复
热议问题