阅读源码你会发现,在升级 IDEA2019、2020后针对文件对比,IDEA 针对忽略的文件不再进行对比。从 idea log
你会发现 抛出了 GitRepositoryNotFoundException。
git4idea.GitUtil$GitRepositoryNotFoundException: Can't find configured git repository for /Users *****
at git4idea.GitUtil.getRootForFile(GitUtil.java:681)
at git4idea.GitContentRevision.loadContent(GitContentRevision.java:74)
at com.intellij.openapi.vcs.impl.ContentRevisionCache.getOrLoadAsBytes(ContentRevisionCache.java:200)
at git4idea.GitContentRevision.getContentAsBytes(GitContentRevision.java:66)
at com.intellij.openapi.vcs.changes.actions.diff.ChangeDiffRequestProducer.createContent(ChangeDiffRequestProducer.java:425)
at com.intellij.openapi.vcs.changes.actions.diff.ChangeDiffRequestProducer.createSimpleRequest(ChangeDiffRequestProducer.java:349)
at com.intellij.openapi.vcs.changes.actions.diff.ChangeDiffRequestProducer.createRequest(ChangeDiffRequestProducer.java:278)
at com.intellij.openapi.vcs.changes.actions.diff.ChangeDiffRequestProducer.loadCurrentContents(ChangeDiffRequestProducer.java:239)
at com.intellij.openapi.vcs.changes.actions.diff.ChangeDiffRequestProducer.process(ChangeDiffRequestProducer.java:201)
at com.intellij.diff.impl.CacheDiffRequestProcessor$Simple.loadRequest(CacheDiffRequestProcessor.java:206)
at com.intellij.diff.impl.CacheDiffRequestProcessor$Simple.loadRequest(CacheDiffRequestProcessor.java:183)
异常源码:

决策代码:

需要你检查:file Types 或略的文件,与你代码路径是否冲突。

PS:idea git plus 源码:
在IDEA 2019、2020版本更新后,对于忽略的文件不再进行对比,导致出现GitRepositoryNotFoundException异常。问题根源在于IDEA无法找到配置的Git仓库。解决方案涉及检查文件类型设置和代码路径,避免冲突。可以查看GitUtil.java源码以获取更多线索。
48万+

被折叠的 条评论
为什么被折叠?



