10000 changes in vs code version control

Hello ! I am new to git and vs code and I have noticed that there are around 10000 changes showing. I don’t know whether to commit them all or discard changes.

I am using git and vs code literally right now.

And I am having hard time trying to understand what changes are you referring to.

Could you elaborate more?

yeah , i think this problem is only with vs code when you also use git .
well i cannot share image as im a new user so i will tell you in detail
below file there are search and source control icons in source control there are two types of staged changes and unstaged changes , in staged changes there is one file in which there are git commands i have performed and in unstaged changes there are9999 diffrent files from images to the things i have deleted .

I think maybe you can share which repository you are concerned with?

i dont understand this

If you are working with git, you are working with some repository.

Staged and unstaged changes - it only makes sense in the context of managing repository, I guess.

can you give more details? it’s for example good practice to .gitignore the node_modules folder, to avoid thousands of changes

well yeah i was working in some repos but the thing is even the files that are not the part of that repos are showing , aprt from that thousands of icon images like asterisk , star , etc are also in that unstaged change , now i am sure that i have never used that many icons in git , i have just recently started learning git so maybe some command that i could have run which resulted in this?

what is the node_module folder , and git ignore

it is hard to say exactly, but that could easily be the case.

Consider to read this docs about gitignore:
https://git-scm.com/docs/gitignore

As for node_modules - it is a folder, which is often present in projects folder and often(always I guess?) is included in the gitignore file.

this is example of gitignore file’s content from small project I am working on:

# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules

# This is if we decide to add testing with Jest
/coverage

# production
/build

# misc
.DS_Store

You’ve either initialised a git repository in the wrong folder or you have loads of files in your folder that you weren’t aware of. If you’re saying it’s not the latter, then it’s the former.

Git creates a folder (called .git/) in the folder of files you want to watch, and in that .git/ folder is stored information about the files you want git to track.

You tell git to track files when you run git init (or click the button in VSCode’s git integration that does the same thing), and if you run that command in the wrong folder it’ll just merrily track everything in that folder.

Simplest way is find which folder you intialised your git repo in (ie the one that has all of these files) and delete the .git folder and start again

Edit: repeating what @admit8490 has said. You kinda need to understand what the node_modules folder is (and by extension what NPM is and how you install stuff) and what a .gitignore file is for (and by extension what git is)

i think im in C/User/username (in my case hp)this folder as the files are showing this path and they are showing untracked , now tell me what to do

Well yes, then you’ve told git to watch every file in that folder

yeah, I did that exactly , I watched a video and then went to the path or location of that folder , searched for the hidden .git file deleted it and then my problem was solved .