How to sync git folders and files like .git or .gitignore?

I noticed that even after enabling syncing hidden files, Nextcloud has problems with .git, .gitignore etc. When I have such files in my local sync folders, there are sync errors and when I’m trying to create such a file/folder in the browser version it cannot be done. I have the newest version of NC and using a desktop sync manger for Ubuntu. There is no problem with other hidden files/folders.

Hopefully it can be enabled in config.php or a similar configuration file.