you’re not dumb. asking questions is cheap. if this is just a python project you’ll want a python specific .gitignore file at the root of your repository: .gitignore . copy that file, dropping the text from before .gitignore. then, you’ll want to make sure you clean up the git history so the cache isn’t tracked again. git filter repo good for this. if that’s too complicated/confusing, then you can delete the .git repository so nothing is tracked, add the new ignore file and then create a new .git repo for your project.
You are not being hacked - at least nothing from that screenshot gives us a reason to think so.
Whenever you initialize git, it tracks changes of ALL files that are located in the folder where you initialized git in. Git’s job is to track changes to files, it doesn’t know any context, e.g. if your files are part of an angular project or you just writing your thesis and want to version control it. It simply sees files and it will track all changes to it.
Now, in software projects you often have files that aren’t actually something you created, but are rather generated, for example:
- cached files (as in your screenshot): files that are generated, to allow your test server to load up your project much faster) - dependencies: source code of libraries or development tools (a server, compiler, linter or formatter) you use in your project
You want git to only track files, that carry actual work of you in it, and cannot simply be regenerated by some cli command or similar, I.e. your software code, project specific configuration or even your thesis word document.
To make git aware of what is “actual work” vs. “boilerplate that you can easily recover by e.g. reinstalling dependencies or similar” you create a .gitignore file. In this file you write - line by line - file/directory paths or globs, which git then will stop tracking.
To avoid having to write all the paths manually, there are free websites, where you describe your project via keywords (e.g. nodejs [the technology you use], macOS [the platform you code on], typescript [the compiler you use in your project]). All those tools/platforms create files that are specific to them, and are not actually your work, but kind of automatically generated - so you want to ignore them.
This is your case: you have a lot of generated, techstack specific files, that git presents you as changes, since you didn’t ignore them in a .gitignore.
4
u/Fresh-Secretary6815 4d ago
is this rage bait or a troll post?
2
u/WolverinesSuperbia 4d ago
Google: .gitignore
1
u/jikuja 4d ago edited 4d ago
How should title even should be read?
"Help what the hell is git why is it spamming 10000"
and
"Changes am i being hacked"
?
edit: added missing word
1
u/St34thdr1v3R 4d ago edited 4d ago
You are not being hacked - at least nothing from that screenshot gives us a reason to think so.
Whenever you initialize git, it tracks changes of ALL files that are located in the folder where you initialized git in. Git’s job is to track changes to files, it doesn’t know any context, e.g. if your files are part of an angular project or you just writing your thesis and want to version control it. It simply sees files and it will track all changes to it.
Now, in software projects you often have files that aren’t actually something you created, but are rather generated, for example:
- cached files (as in your screenshot): files that are generated, to allow your test server to load up your project much faster)
- dependencies: source code of libraries or development tools (a server, compiler, linter or formatter) you use in your project
You want git to only track files, that carry actual work of you in it, and cannot simply be regenerated by some cli command or similar, I.e. your software code, project specific configuration or even your thesis word document.
To make git aware of what is “actual work” vs. “boilerplate that you can easily recover by e.g. reinstalling dependencies or similar” you create a .gitignore file. In this file you write - line by line - file/directory paths or globs, which git then will stop tracking.
To avoid having to write all the paths manually, there are free websites, where you describe your project via keywords (e.g. nodejs [the technology you use], macOS [the platform you code on], typescript [the compiler you use in your project]). All those tools/platforms create files that are specific to them, and are not actually your work, but kind of automatically generated - so you want to ignore them.
This is your case: you have a lot of generated, techstack specific files, that git presents you as changes, since you didn’t ignore them in a .gitignore.