The pre-commit hook will exit non-0 if there's a .meta file without a corresponding non-meta file. Empty directories in Unity will create .meta files, but Git won't allow you to add empty directories to the index. The conventional workaround for this is adding a .gitkeep dummy file in the directory to make Git "notice" the directory. However, adding an invisible file in a directory doesn't create a .meta file for it, causing the same problem.
If you're using Rider in an empty project, this will always lead to an error loop, since the plugin will add an Assets/Plugins/Editor folder, while we've ignored the JetBrains folder that gets added to it. A .meta file for the directory is created, but Git thinks the directory is empty. (It doesn't really make any sense to me, since it sees the .meta file, but whatever.)
Adding any unignored Unity asset to the editor folder will trigger Git to add the folder to the index, but that's a rather silly solution.
The pre-commit hook will exit non-0 if there's a
.metafile without a corresponding non-meta file. Empty directories in Unity will create.metafiles, but Git won't allow you to add empty directories to the index. The conventional workaround for this is adding a.gitkeepdummy file in the directory to make Git "notice" the directory. However, adding an invisible file in a directory doesn't create a.metafile for it, causing the same problem.If you're using Rider in an empty project, this will always lead to an error loop, since the plugin will add an
Assets/Plugins/Editorfolder, while we've ignored the JetBrains folder that gets added to it. A.metafile for the directory is created, but Git thinks the directory is empty. (It doesn't really make any sense to me, since it sees the.metafile, but whatever.)Adding any unignored Unity asset to the editor folder will trigger Git to add the folder to the index, but that's a rather silly solution.