Skip to content

Instantly share code, notes, and snippets.

@Sieboldianus
Last active September 15, 2025 05:34
Show Gist options
  • Save Sieboldianus/280afdb2f994fae6e5f6b183888f659d to your computer and use it in GitHub Desktop.
Save Sieboldianus/280afdb2f994fae6e5f6b183888f659d to your computer and use it in GitHub Desktop.
An opinionated nextcloud ignore list for developers (sync-exclude.lst)

An opinionated nextcloud ignore list for developers (sync-exclude.lst)

The latest nextcloud server versions will have ransomware detection automatically enabled, meaning that syncing common developer file types (e.g. .lock) will return errors.

Fatal webdav OCA\DAV\Connector\Sabre\Exception\Forbidden: Ransomware file detected. Prevented upload of ..py/bokeh/secrets.tar.enc because it matches extension pattern ".enc"

If you are syncing complex, nested work directories as a developer, the following list can be used, as a starting point, to exclude certain common file types and folders.

Examples:

  • .git/: folder will not be synced (but the latest files checked out, will)
  • node_modules/: (JS) will not be synced, preventing syncing of a massive quantity of unnecessary dependencies
  • cython_debug/: C-Extensions for Python debug directories
  • _site/: Commonly used for building static sites and serving temporary files (mkdocs serve, hugo serve)

Some files indeed are synced:

  • .env files, since I do not version these in git

The motivation behind this approach is that Nextcloud should not be used as a backup solution, but for syncing working files. For instance, if you want to continue working at home on selected files (*.md, *.odt), this will be possible. For checking out the latest git repositories, or dependencies, use the native approach (e.g. git pull for repositories, npm install for node_modules/).

If you then want to re-initiatlize your git folder in your existing Nextcloud sync, on another computer, you need to be aware that some files not excluded in your Nextcloud will indeed be synced. Use this command to re-init a git folder where files already exist:

git clone https://myrepo.com/git.git temp" \
    && echo "mv temp/.git code/.git" \
    && echo "rm -rf temp" 
    && echo "cd code" 
    && echo "git restore .

Filelist sync-exclude.lst

Note: The file list is not exhaustive, please comment or update.

Setup

Clone this gist:

git clone [email protected]:280afdb2f994fae6e5f6b183888f659d.git
mv 280afdb2f994fae6e5f6b183888f659d nextcloud_ignore_gist
cd nextcloud_ignore_gist

Copy sync-exclude.lst file to:

%AppData%/Nextcloud/sync-exclude.lst
*~
~$*
.~lock.*
~*.tmp
]*.~*
]Icon\r*
].DS_Store
].ds_store
*.textClipping
._*
]Thumbs.db
]photothumb.db
System Volume Information
.*.sw?
.*.*sw?
].TemporaryItems
].Trashes
].DocumentRevisions-V100
].Trash-*
.fseventd
.apdisk
.Spotlight-V100
.directory
*.part
*.filepart
*.crdownload
*.kate-swp
*.gnucash.tmp-*
.synkron.*
.sync.ffs_db
.symform
.symform-store
.fuse_hidden*
*.unison
.nfs*
My Saved Places.
\#*#
*.sb-*
*.dll
*.exe
.git/
.lock
*.bin
.bin
bin/
*.lock
node_modules/
.cache/
.vscode/
.pytest_cache/
.github/
.ipynb_checkpoints/
*.exe
*.dll
*.class
*.com
*.so
*.o
@*/
__pycache__/
.Python/
build/
dist/
eggs/
.eggs/
wheels/
sdist/
var/
*.egg/
*.egg-info/
lib64/
lib/
.tox/
.nox/
env/
venv/
ENV/
env.bak/
venv.bak/
site/
cython_debug/
vendor/
tmp/
.libs/
.debs/
src/
Debug/
debug/
*.pdb
*.enc
.enc
.sass-cache/
_site/
.info
*.info
.jekyll-cache
.jekyll-cache/
.zotero-ft-cache
.zotero-ft-info
*.idlk
zotero.sqlite.bak
*.dwl
*.dwl2
*.bkp
*.dtmp
.$*
*.tmp
_build/
.venv/
@joennlae
Copy link

Thank you this is perfect 💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment