Force-Sync Specific Hidden Files

Nextcloud version (eg, 20.0.5): 25.0.2
Operating system and version (eg, Ubuntu 20.04): Debian 11
Apache or nginx version (eg, Apache 2.4.25): Apache
PHP version (eg, 7.4): 8.1

Steps to replicate it:

  1. try to sync a folder that has specific hidden files in it (.gitignore, .gitkeep)

The output of your Nextcloud log in Admin > Logging:

Server replied "404 Not Found" to "PUT https://domain/path/to/.gitignore"

I do a lot of code development and recently decided to include my code projects as folder sync within NC.

Problem is, specific hidden files are not sync’ing. They are important hidden files that I would like to preserve between my local system and the NC server. .gitignore and .gitkeep being primary examples. The server reports 404 Not Found issues, but only for SOME hidden files, specifically the hidden files I want to preserve.

I do have “sync hidden files” set in the desktop client.

MOST hidden files sync fine. Only specific hidden files (ones I care about) are erroring out.

I can get around this by rsync’ing my local dir to the server dir, adjusting the owner, and then running occ files:scan-all, but that’s a bit of a pain to have to do every time I work with github repo files. I’d like to resolve it so that these files sync smoothly as part of the standard sync process.

Any ideas how to resolve this?