Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.gitignore Doesn't Seem To Work

Tags:

git

gitignore

My .gitignore:

.DS_Store
/.idea
/.idea_modules
/out
/project
/target
/*.iml
*/resolution-cache/*
*/streams/*
*/target/*

But nonetheless, the folders .idea, .idea_modules and target have appeared in a repo and are still there.

Your ideas?

like image 922
Alan Coromano Avatar asked Nov 27 '25 18:11

Alan Coromano


1 Answers

Ignoring is only useful for files that are not currently being tracked by the repo. If those directories were added to the repo before being put in .gitignore, they will continue to be tracked.

Use git rm --cached <file> to stop tracking a file.

Of course you should make a commit with the removed files and push to the repo to see the changes in the remote repository

like image 132
Max Avatar answered Nov 30 '25 11:11

Max



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!