Iv'e added:
*.iml
to all of the gitignore files in my project. They are still being tracked, even after committing the .gitignore.
. gitignore only ignores files that are not part of the repository yet. If you already git add ed some files, their changes will still be tracked. To remove those files from your repository (but not from your file system) use git rm --cached on them.
iml files are not really needed and can be gitignore'd. *. iml files are created by IntelliJ IDEA based on the pom. xml file read by Maven to resolve dependencies of the project.
Check the file you're ignoring gitignore will not ignore a file if it's already present or is part of a repository. In other words, Git can only ignore untracked files. Take a good look at your structure, and make sure you're trying to ignore the file that isn't already committed to your repository.
git will track the files sometimes even if you added the file which shouldn't be tracked in .gitignore
In that case you should remove the cache first then add all.
Important : Before, commit or stash your current changes
$ git rm -r --cached .
$ git add .
$ git commit -m "file tracking - changed"
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