Search code examples
laravelgitvue.jsgitignore

How to add Larvel Log file in gitignore


/storage/logs/laravel.log

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


Solution

  • /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