Search code examples
gitgitignore

How do I make git stop tracking files with the same extension?


I want git to stop tracking the .class files of my folder, I don't really need them to be tracked, I know I can put their names on .gitignore but is there a way to just ignore any future, past and present things that has the .class extension?


Solution

  • Yes there is! Just add this (on a separate line) to your .gitignore:

    *.class
    

    The * serves as a wildcard to match any string (so it could be any file name)