ignoring the idea folder is fine as not everyone uses them, and they are not part of your code - you (hopefully) don't need them on production, for instance. ignoring is fine, but removing is less of a good idea. It contains information for your local workspace. I'm surprised this is down-voted.
gitignore ignores only untracked files. Your files are marked as modified - meaning they were committed in the past, and git now tracks them. To ignore them, you first need to delete them, git rm them, commit and then ignore them.
The Solution To resolve the problem remove from the repository the tracked files contained in the . gitignore file. To achieve this use “git rm” to remove and untrack all the files in the repository, then use “git add” to re-add all the files (the files contained in the .
.gitignore
only ignores newly added (untracked) files.
If you have files that have already been added to the repository, all their changes will be tracked as usual, even if they are matched by .gitignore rules.
To remove that folder from the repository (without deleting it from disk), do:
git rm --cached -r .idea
add .idea/
to .gitignore file
run this commands in terminal to complete mission :)
git rm -rf .idea
git commit -m "delete .idea"
git push
To remove the "fatal: pathspec '.idea' did not match any files" just use if the dir still returns as untracked:
git clean -f -d .idea
git rm --cached .idea/
echo '.idea' >> .gitignore
git add .gitignore
git commit -m "Removed .idea files"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With