运行命令
git status在laravel项目的根目录中,我看到了很多信息,比如:
Changes not staged for commit:
(use "git add/rm <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
...
deleted: vendor/phpdocumentor/reflection-common/phpstan.neon
deleted: vendor/phpdocumentor/reflection-common/psalm.xml
...
deleted: vendor/phpdocumentor/reflection-docblock/.dependabot/config.yml
deleted: vendor/phpdocumentor/reflection-docblock/.github/workflows/push.yml
deleted: vendor/phpdocumentor/reflection-docblock/Makefile
deleted: vendor/phpdocumentor/reflection-docblock/composer-require-config.json
git add vendor/phpdocumentor/reflection-docblock/composer.json
deleted: vendor/phpdocumentor/reflection-docblock/phive.xml
deleted: vendor/phpdocumentor/reflection-docblock/phpcs.xml.dist
deleted: vendor/phpdocumentor/reflection-docblock/phpstan.neon
deleted: vendor/phpdocumentor/reflection-docblock/psalm.xml
git add vendor/phpdocumentor/reflection-docblock/src/DocBlock/StandardTagFactory.php
git add vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Deprecated.php
git add vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/InvalidTag.php
git add vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Since.php
git add vendor/phpdocumentor/type-resolver/composer.json
git add vendor/phpdocumentor/type-resolver/src/Types/Compound.php
git add vendor/phpoffice/phpspreadsheet/CHANGELOG.md
git add vendor/phpoffice/phpspreadsheet/composer.json
git add vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Calculation.php
git add vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Category.php我想知道为什么会这样,就像在根.gitignore中一样:
/node_modules
/public/hot
/public/storage
/storage/*.key
/vendor
/.idea
/__DOCS/
/__SQL/
package-lock.json
package.json
.env
.phpunit.result.cache
Homestead.json
Homestead.yaml
npm-debug.log
yarn-error.log
composer.lock
1.txt我料到这句话
/vendor使自动生成的/vendor dir中的所有更改对于git不可见。上一次是这样工作的,好像上个月我还没有修改根.gitignore,你能说出发生了什么,以及根.gitignore的有效格式是什么吗?
谢谢!
发布于 2020-09-20 10:18:38
Git正在跟踪您的vendor目录。尝试将其从索引中删除。
要停止跟踪,需要从索引.中删除文件夹。。
git rm -r --cached vendor
这将不会删除保存在工作目录中的任何内容。
https://stackoverflow.com/questions/63977805
复制相似问题