Problem
Sometimes when another git branch is checked out or a Maven project is reloaded, the vcs.xml file gets automatically modified and causes issues with the project's git integration.
Example of vcs.xml content before the branch switch/project reload:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
After the branch switch/project reload:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>
Resolution
Close IDE, delete .idea folder and any *.iml files in your project root folder in the file explorer, and re-import the project from existing sources. It will recreate the project configuration from scratch.
Note: If there is a lot of project-level configuration, it is recommended to move/backup the .idea folder instead of deleting it.
Comments
0 comments
Please sign in to leave a comment.