Problem
Rider fails to show the diff of a file in the wwwroot directory, with the error: "Cannot show diff: Cannot find configured Git repository for ".
The Git CLI does not show this error.
Cause
The IDE treats the directory (or its Git root) as ignored or excluded. This can happen in more than one place:
- The directory is listed under Editor > File Types > Ignored Files and Folders.
- The directory's content root is marked Excluded (right-click the directory in the Project tool window and check Mark Directory As).
- Version Control > Directory Mappings does not point at the correct Git root.
Any of these maps the file to a null Git root internally. Diff, Local Changes, and Annotate then fail. Git Log and file history keep working, because they skip this root-mapping check.
Resolution
- Open Rider.
- Open Settings (
⌘ + ,on macOS,Ctrl + Alt + Son Windows or Linux). - Check Editor > File Types > Ignored Files and Folders. Remove any entry matching the directory or its parent.
- Check Version Control > Directory Mappings. Make sure it maps the project to the correct Git root.
- In the Project tool window, right-click the directory and check Mark Directory As. Make sure it is not set to Excluded.
- Apply the changes and restart Rider.
- Retest.
Comments
0 comments
Please sign in to leave a comment.