如何在 gitignore 中添加 Larvel 日志文件

发布于 2025-01-09 03:42:12 字数 83 浏览 1 评论 0原文

/storage/logs/laravel.log

我添加了这段代码,但它不起作用。我们将感谢您的帮助

/storage/logs/laravel.log

I Added this Code But it's Not Working. Your Help will be Appreciated

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

秉烛思 2025-01-16 03:42:13
/node_modules
/public/hot
/public/storage
/storage/*.key
/vendor
.env
.env.backup
.phpunit.result.cache
docker-compose.override.yml
Homestead.json
Homestead.yaml
npm-debug.log
yarn-error.log
/.idea
/.vscode

这是 Laravel 提供的 .gitignore 文件。

但是,如果您已经提交了存储文件夹,请先从 github 中删除它们,这样 git 就不会跟踪它们。

这是我定制的 .env:

vendor/
!public/vendor
node_modules/
npm-debug.log
.php_cs.cache

# Laravel 5 & Lumen specific
public/storage
public/hot
storage/*.key
storage/clockwork
.env.*.php
.env.php
.env
.env-production
Homestead.yaml
Homestead.json
.phpunit.result.cache
coverage/**

# Rocketeer PHP task runner and deployment package. https://github.com/rocketeers/rocketeer
.rocketeer/

# Phpstorm
.idea
_ide_helper.php
_ide_helper_models.php
.phpstorm.meta.php
.DS_Store
app/Repositories/Interfaces/UserRepositoryInterface
app/Repositories/UserRepository
App\Repositories\UserRepository
App\Repositories\Interfaces\UserRepositoryInterface
# Elastic Beanstalk Files
.elasticbeanstalk/*
!.elasticbeanstalk/*.cfg.yml
!.elasticbeanstalk/*.global.yml
storage/app/*
/tmp/
.vscode/settings.json
.php-cs-fixer.cache
/node_modules
/public/hot
/public/storage
/storage/*.key
/vendor
.env
.env.backup
.phpunit.result.cache
docker-compose.override.yml
Homestead.json
Homestead.yaml
npm-debug.log
yarn-error.log
/.idea
/.vscode

Here is .gitignore file provided by Laravel.

However, If you already commited your storage folder delete them from github first so the git won't track them.

This is my .env customised:

vendor/
!public/vendor
node_modules/
npm-debug.log
.php_cs.cache

# Laravel 5 & Lumen specific
public/storage
public/hot
storage/*.key
storage/clockwork
.env.*.php
.env.php
.env
.env-production
Homestead.yaml
Homestead.json
.phpunit.result.cache
coverage/**

# Rocketeer PHP task runner and deployment package. https://github.com/rocketeers/rocketeer
.rocketeer/

# Phpstorm
.idea
_ide_helper.php
_ide_helper_models.php
.phpstorm.meta.php
.DS_Store
app/Repositories/Interfaces/UserRepositoryInterface
app/Repositories/UserRepository
App\Repositories\UserRepository
App\Repositories\Interfaces\UserRepositoryInterface
# Elastic Beanstalk Files
.elasticbeanstalk/*
!.elasticbeanstalk/*.cfg.yml
!.elasticbeanstalk/*.global.yml
storage/app/*
/tmp/
.vscode/settings.json
.php-cs-fixer.cache
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文