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:
Great breakdown on Umbraco ModelsBuilder line endings! Managing consistent formatting is essential for clean code and smooth collaboration. It's a smart move to Hire Umbraco Developers who are experienced with these technical details and version control setups.
ReplyDelete