Make Obsidian fast on mobile (with the Git plugin)

08 June 2024

Speeding Up Obsidian Using GIT_DIR in the Git Plugin

I use Obsidian for note-taking and sync my files via Apple Files. However, I noticed that Obsidian became very slow after adding a Git repository to my vault. Here’s how I fixed it by configuring the GIT_DIR option in the Obsidian Git plugin. ## The Problem

Obsidian slowed down significantly when a a big Git repository (> 500mb ) was present in my vault. The .git folder in the vault caused Obsidian to scan and process it, leading to delays in loading, searching, and navigating files.

The Solution: GIT_DIR in Obsidian Git Plugin

You can resolve this issue by setting the GIT_DIR in the Obsidian Git plugin to keep the .git folder outside the vault. Here’s how:

  1. Move the .git Folder: Move the .git folder from your vault to a location outside the vault. For example:
    mv ~/Documents/ObsidianVault/.git ~/Documents/ObsidianGit/
    
  2. Configure the Git Plugin:
    • Open Obsidian and go to the settings.
    • Navigate to the Obsidian Git plugin settings.
    • In the “Additional PATH environment variable paths” field, set GIT_DIR to the new location of your .git folder, e.g., GIT_DIR=/Users/username/Documents/ObsidianGit/.git.
  3. Use Git as Usual: With these settings, the Git plugin in Obsidian will use the relocated .git folder, allowing you to use Git commands normally without slowing down Obsidian.

For more details, check the Obsidian forum thread.

Jankees van Woezik profile picture

Hello, I'm Jankees van Woezik

Like this post? Follow me at @jankeesvw on Twitter