首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >为什么git状态显示在/vendor dir下的文件?

为什么git状态显示在/vendor dir下的文件?
EN

Stack Overflow用户
提问于 2020-09-20 10:11:50
回答 1查看 238关注 0票数 0

运行命令

代码语言:javascript
复制
git status

在laravel项目的根目录中,我看到了很多信息,比如:

代码语言:javascript
复制
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中一样:

代码语言:javascript
复制
/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

我料到这句话

代码语言:javascript
复制
/vendor

使自动生成的/vendor dir中的所有更改对于git不可见。上一次是这样工作的,好像上个月我还没有修改根.gitignore,你能说出发生了什么,以及根.gitignore的有效格式是什么吗?

谢谢!

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-09-20 10:18:38

Git正在跟踪您的vendor目录。尝试将其从索引中删除。

要停止跟踪,需要从索引.中删除文件夹。

git rm -r --cached vendor

这将不会删除保存在工作目录中的任何内容。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/63977805

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档