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?

1 Like

Just to confirm that I’m experiencing the same issue – in my case, hidden .git directories are not synced by the macOS desktop client, instead the client reports the same ‘Server replied “404 Not Found”’ error for these directories.

I just started adding those directories to my nextcloud so cannot say if it’s a new issue.

Just like codejp3 I use Git as part of my regular workflow for some key documents and would like to make sure the repositories are fully synced in Nextcloud.

Server: Nextcloud Hub 3 (25.0.3) with PHP 7.4.30 and Apache/2.4.54 (Debian)
Client: Nextcloud desktop 3.6.6 on macOS

In the client I have checked the “Sync hidden files” option and made sure the list of exclusions does not include an exception for .git files.

FWIW, I resorted to not using Next cloud for GitHub repo files and other files that had these errors. Instead, I wrote a script to handle backups to the server via rsync. It doesn’t look like NC plans to make this work anytime in the near future, even though sharing code repos with others would be an awesome feature.