4

The code below is what I have tried in the .gitignore file. Other folders when I put logs or **/wwwroot and save the file, every file in the folder is ignored but this object folder in the core project is not ignored somehow.


obj/project.assets.json
obj/Debug/netcoreapp3.1/CDS.PORTAL.assets.cache
obj/Debug/netcoreapp3.1/CDS.PORTAL.csproj.FileListAbsolute.txt
obj/Debug/netcoreapp3.1/CDS.PORTAL.csprojAssemblyReference.cache
obj/Debug/netcoreapp3.1/staticwebassets/CDS.PORTAL.StaticWebAssets.Manifest.cache
obj/Debug/netcoreapp3.1/staticwebassets/CDS.PORTAL.StaticWebAssets.xml

Screenshot of VS Code

Andrei Mustata
  • 1,013
  • 1
  • 9
  • 21
Jay Liu
  • 59
  • 7
  • i think you should attach your .gitignore – Silver May 28 '20 at 07:38
  • the code box is the gitignore file contents. The image below shows in VIsual studio code that the files still want to be pushed to the github after I ignired the folder – Jay Liu May 28 '20 at 07:48
  • 1
    please check if the file is already tracked by git, or using `git status` commandline to comfirn, I do not know much about the git extension in vscode – Silver May 28 '20 at 13:51

1 Answers1

2

The M next to the file names in VS Code stands for Modified. See git status modes.

Seems like at some point you've added those files to git, then added those entries to .gitignore later. git now knows those files exist and keeps track of them, and doesn't automatically rewrite, even though you have a new .gitignore list.

If you still want to do this, check this similar question: How to make Git "forget" about a file that was tracked but is now in .gitignore?

Andrei Mustata
  • 1,013
  • 1
  • 9
  • 21