我正在学习 Laravel 8,我想使用 Laravel Sail 设置一个快速开发环境。
由于我们通常不会提交到 Git 中的供应商目录,我们如何从一个新的 Git 克隆运行 Sail?没有它我们就不能使用“composer install”。这是否意味着我们应该提交 vendor/bin 和 vendor/composer 文件夹?有哪些常见的做法?
我们是否应该将/vendor/bin 提交到 git 以获得开箱即用的新开发环境?
最佳答案
我偶然发现了完全相同的问题。
在文档中有以下部分解决了这个问题:
You may install the application's dependencies by navigating to the application's directory and executing the following command. This command uses a small Docker container containing PHP and Composer to install the application's dependencies:
docker run --rm \
-v $(pwd):/opt \
-w /opt \
laravelsail/php80-composer:latest \
composer install
https://laravel.com/docs/8.x/sail#installing-composer-dependencies-for-existing-projects当然,您还必须准备 .env-File 和其他未提交的依赖项。
关于git - 带有 Laravel Sail 和版本控制的 Laravel 8 开发项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65718159/