Cause: A file has been committed before the. Ignore file is added (or a file is ignored before being added), and the configuration corresponding to the. Ignore file becomes invalid. Solution: Run the following command to commit and push again.

git rm -r --cached *.iml

*. Iml is an invalid file or directory in the. Ignore file

1. In idea, enter the command in the icon and press Enter

2. Right-click the project in the folder, select Git bash here, enter the command in the displayed dialog box, and press Enter