Showing posts with label umbraco. Show all posts
Showing posts with label umbraco. Show all posts

Wednesday, February 24, 2021

Umbraco modelsbuilder line endings

Everytime the modelsbuilder detects a change in LiveAppData moe, the generated file will be touched.

Git uses auto line-endings, meaning CRLF on windows, while the umbraco models builder uses LF (https://github.com/modelsbuilder/ModelsBuilder.Original/blob/v4/dev/src/Our.ModelsBuilder/Building/CodeWriterBase.cs#L65) This is seen as a change, but when running git add this change is corrected by git and then dropped.

This is very annoying, but easy to fix with a .gitattributes file. As a base I've used the one in the UmbracoCms repository, and extended it with the path to the models builder output: