This approach, although probably not what you would like to hear, helped git detect renames (and ultimately understand the real file history) during a pretty big repackaging that I was doing (renaming package com.something
to com.somethingelse
with ~300 files inside it):
- Do the renaming only outside of IntelliJ using "git mv" e.g. "
git mv MyProject\src\main\java\com\something MyProject\src\main\java\com\somethingelse
"
- Commit
- Do the repackaging changes in the source files using a regular IntelliJ text-replace -
Edit > Find > Replace in path
and replace all occurrences of com.something
with com.somethingelse
.
- Commit