Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.gitignore not ignoring .idea path

Tags:

git

gitignore

People also ask

Should .idea folder be ignored?

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.

Why files in Gitignore are not ignored?

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.

Why isn't my Gitignore working?

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


Remove the file from the repository run below command

git rm --cached .idea/

now update your gitignore file to ignore .idea folder run below command

echo '.idea' >> .gitignore

add the .gitignore file

git add .gitignore

git commit -m "Removed .idea files"