obsidian-livesync icon indicating copy to clipboard operation
obsidian-livesync copied to clipboard

LiveSync does not honor .gitignore or ignore patterns, keeps syncing all files

Open ghost opened this issue 5 months ago • 1 comments

Abstract:
I want LiveSync to ignore image files or image folders inside my Obsidian vault by using either a .gitignore file or the plugin’s Ignore Patterns input. However, LiveSync keeps syncing all images and logs repeatedly show:
[HiddenFileSync] Hidden file will skip 0 files
and
Failed to read ignore file .gitignore.

Expected behaviour:

  • LiveSync correctly reads the .gitignore file from the vault root and applies ignore rules.
  • LiveSync respects the Ignore Patterns configured in the plugin settings.
  • Image files (e.g., .jpg, .png) or folders are excluded from sync according to these ignore rules.

Actual behaviour:

  • LiveSync repeatedly logs "Failed to read ignore file .gitignore".
  • LiveSync does not skip image files or folders and uploads them regardless of .gitignore or ignore patterns.

Steps to reproduce:

  1. Place a .gitignore file in the vault root with content like:

    meta/images/
    *.jpg
    *.png
    *.gif
    *.jpeg
    
  2. Set Ignore Patterns in LiveSync plugin settings to:

    *.jpg
    *.png
    *.gif
    *.jpeg
    meta/images/
    

^00 meta/images/ .(png|jpe?g|gif|svg|webp)$

  1. Sync the vault using LiveSync.
  2. Check logs for errors like Failed to read ignore file .gitignore and note that no files are skipped (Hidden file will skip 0 files).
  3. Confirm that image files and folders are still synced despite ignore rules.

Additional info:

  • Tried various syntaxes and locations but issue persists.

Logs:

7/28/2025, 5:11:07 PM->[ModuleTargetFilter]  Failed to read ignore file .gitignore 7/28/2025, 5:11:07 PM->[ModuleTargetFilter]  Failed to read ignore file .gitignore 7/28/2025, 5:11:07 PM->[ModuleTargetFilter]  Failed to read ignore file .gitignore 7/28/2025, 5:11:07 PM->[ModuleTargetFilter]  Failed to read ignore file .gitignore 7/28/2025, 5:11:07 PM->[ModuleTargetFilter]  Failed to read ignore file .gitignore

7/28/2025, 4:58:05 PM->[HiddenFileSync]  Hidden file will skip 0 files

Environment:

  • Obsidian version: latest
  • LiveSync plugin version: latest
  • OS: Windows and ios

ghost avatar Jul 28 '25 21:07 ghost

This is still happening, I am trying to ignore a folder called "temp" and it is still syncing, using the same process as above.

nick16180 avatar Dec 15 '25 16:12 nick16180