When submitting code with IDEA, modified:.idea/workspace.xml keeps showing up during the commit.

Question why

The reason is Git ignore. When Git synchronizes code, the premise of setting a local ignore file is to ensure that Git remote repository does not have the file to be ignored. Ignore, set locally, will no longer take effect when the remote contains the file.

The solution

Delete a record on Git

git rm -r --cached .idea/*
Copy the code

Add the.idea folder to.gitignore and commit

Git commit -m "Delete.idea file and add to ignore"Copy the code

Push the change record to the remote

git push
Copy the code