Skip to content

Netlify CLI keeps adding overzealous and incorrect rule to .gitignore #2029

@SleeplessByte

Description

@SleeplessByte

Describe the bug

In my .gitignore I have the following intentional line:

/.netlify

Linking a new site / running CLI in several ways will incorrectly add:

# Local Netlify folder
.netlify

In order to make my monorepos work again I have to add:

!sites/**/.netlify

To Reproduce

Steps to reproduce the behavior:

  1. Create a new git repo
  2. Add .gitignore with /.netlify
  3. Run netlify deploy
  4. It has added the line to .gitignore

Configuration

npx envinfo --system --binaries --npmPackages netlify-cli --npmGlobalPackages netlify-cli


  System:
    OS: Windows 10 10.0.19042
    CPU: (12) x64 Intel(R) Core(TM) i7-6800K CPU @ 3.40GHz
    Memory: 5.80 GB / 31.91 GB
  Binaries:
    Node: 12.18.2 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.4 - ~\Documents\GitHub\delftsolutions\@introcloud\app\node_modules\.bin\yarn.CMD
    npm: 6.14.5 - C:\Program Files\nodejs\npm.CMD
  npmPackages:
    netlify-cli: ^3.10.12 => 3.10.12

Expected behavior

It does not add .netlify to .gitignore.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions