Finally Solved
This little trick helped me. It removes all files that have been cached as being 'tracked', then re-adds files based on the .gitignore file
First:
remove (git rm) all files recursively (-r) that are cached as being tracked
git rm -r --cached .
Then:
Add all (git add .) files that have changed/aren't accounted for in the cache back; this will re-add the files as they were, so there won't be a need to 're-save' the files, they'll just disappear from git changes that would've removed the file (and all other files due to the first command)- result is that "changes" or git status should just have the files that are now going to be ignored by .gitignore if they were not before the .gitignore change.
git add .
Resource:
https://sigalambigha.home.blog/2020/03/11/how-to-refresh-gitignore/
This was a long struggle for me, finally I have my dll's being quiet when I just want to merge my changes back into main!
my .gitignore for a dotnet core project:
"
\# file types<br>
*.cache<br>
*.dtbcache.v2<br>
*.dll<br>
*.pdb<br>
*.suo<br>
.suo<br>
*.testlog<br>
*.user<br>
\# directories<br>
**/Release
"