1

In Sourcetree, I have 1350 unstaged files because of me updating node modules. I don't want it to track node modules.

enter image description here I have the following structure: enter image description here

And in the .gitignore I have node modules, see:

    # See http://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
/dist
/tmp
/out-tsc

# dependencies
/node_modules

# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

# misc
/.sass-cache
/connect.lock
/coverage
/libpeerconnection.log
npm-debug.log
yarn-error.log
testem.log
/typings

# System Files
.DS_Store
Thumbs.db

I don't see why is it still tracking the node modules if it is in gitignore

phd
  • 82,685
  • 13
  • 120
  • 165
IkePr
  • 900
  • 4
  • 18
  • 44
  • Possible duplicate of [How to make Git "forget" about a file that was tracked but is now in .gitignore?](https://stackoverflow.com/questions/1274057/how-to-make-git-forget-about-a-file-that-was-tracked-but-is-now-in-gitignore) – phd Oct 31 '19 at 15:54

1 Answers1

0

I think /node_modules entry make git ignore only the modules folder in the root directory. You have yours in the Code directory, not in the root one.

Try using just node_modules.

Ivan Kashtanov
  • 674
  • 4
  • 17