What am I missing that needs to be done in order to get git
to ignore my .idea/
path?
ctote@ubuntu:~/dev/1$ git status
On branch master
add .idea/
to .gitignore file
run this commands in terminal to complete mission :)
git rm -rf .idea
git commit -m "delete .idea"
git push
check this if git status still shows .idea even if .idea/* is already added in your .gitignore file
git rm --cached .idea/
echo '.idea' >> .gitignore
git add .gitignore
git commit -m "Removed .idea files"
If, after following steps from other answers, you still find that your instance of git running in bash or powershell just keeps on tracking the .idea/ folder, then try this!
I discovered that Jet Brains IDE's have their own .gitignore, and run their own instance of git that will override your .gitignore settings!
What I did to fix this was to navigate to /.idea/.gitignore, and change its contents to:
/**
so as to ignore everything in the folder.
The image below shows how you can navigate to the .gitignore file from within your Jetbrains IDE.
.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
For ignoring .idea
folder and iml
file types, I did the following: