How do I clean up the .gitignore file?
问题 Is there git command that can be used to remove lines in .gitignore that are not used? In other words, I want to remove patterns that will not make a difference for the project. 回答1: There is nothing built in to Git to do this, so you would have to write your own code, probably using git check-ignore. Such a program would be quite complex since some ignore entries might be unused because of other existing ignore entries. As a somewhat silly example, if one entry says *.a , one says *.b , and