I have a similar scenario as those described here and here: I want to have a single .editorConfig file, but be able to commit it to multiple repos (one to many). I have read that there are some issues with creating softlinks and symlinks on git, but I have not found much about hardlinks.
My questions:
- Is this discouraged somehow? I understand that specific projects might have specific
editorConfigrequirements. Also, that changing one of the files will generate a git change in multiple repos, but this does not bother me, since I pretend the style to be consistent across my repos (I work mainly withc#). - Will it behave differently in different environments with git (linux, osx, windows)?
I had a similar situation too. I have a repository that contains the
.editorconfigfile. This repo is a single source of truth for coding guideline. I also have several (approximately 40) code repositories written by C#.For local environment:
workfolder; or if this is my personal project, it goes into thepersonalfolder, etc. I copy the.editorconfigfile from the guideline repository to the same level as my repository folder. Thus, whole repositories can use a single/same.editorconfigfile. I also have a specific.editorconfigfile in thepersonalfolder. So, I can override some repository rules like this. Maybe you do not like my copying approach, but I do not think these rules are changed often.For continuous integration:
.editorconfigfile to the build directory. In this way,dotnet buildcommand finds the.editorconfigfile and uses it.I know this is not a solid solution to your question but I wanted to give an idea.