Fixing Git LFS Integration in Obsidian’s Git Plugin on macOS
If you’re using the Obsidian Git plugin with Git LFS (Large File Storage) on macOS, you may run into a frustrating issue: git-lfs
works fine in your terminal, but Obsidian Git throws this error:
This repository is configured for Git LFS but ‘git-lfs’ was not found on your path.
Even after running git lfs install
and configuring .gitattributes
correctly, Git LFS fails — and so do pushes involving large files.
🧠 The Problem: GUI apps ignore your shell config
When you launch Obsidian from the Dock, Spotlight, or Finder:
- It does not load your
~/.zprofile
,~/.bashrc
, orconfig.fish
. - It does not inherit the same
$PATH
you see in your terminal. - So anything installed in
/usr/local/bin
, likegit-lfs
, is invisible to Obsidian’s Git plugin.
✅ The Solution: A Custom .app
Launcher With a Fixed $PATH
Instead of trying to patch macOS’s environment or launchctl quirks, the simplest and most reliable fix is:
🛠 Build a wrapper
.app
that launches Obsidian with the correct environment.
This gives you:
- A real clickable macOS app
- The ability to fix
$PATH
permanently - A proper app icon and dock integration
🚀 How to Build the App
1. Create the directory structure
mkdir -p ~/Applications/Obsidian\ With\ Git\ LFS.app/Contents/{MacOS,Resources}
- Add a wrapper script
Create the file: ~/Applications/Obsidian With Git LFS.app/Contents/MacOS/Obsidian With Git LFS
#!/bin/bash
export PATH="$HOME/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Obsidian.app/Contents/MacOS/Obsidian "$@"
Make it executable:
chmod +x ~/Applications/Obsidian\ With\ Git\ LFS.app/Contents/MacOS/Obsidian\ With\ Git\ LFS
- Add a valid Info.plist
Create Contents/Info.plist with this content:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
plist version="1.0">
<dict>
<key>CFBundleName</key>
<string>Obsidian With Git LFS</string>
<key>CFBundleIdentifier</key>
<string>com.example.obsidian-lfs-launcher</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleExecutable</key>
<string>Obsidian With Git LFS</string>
<key>CFBundleIconFile</key>
<string>icon.icns</string>
<dict>
</plist> </
- Copy the Obsidian icon
cp /Applications/Obsidian.app/Contents/Resources/icon.icns \
~/Applications/Obsidian\ With\ Git\ LFS.app/Contents/Resources/icon.icns
- Refresh Finder and Dock
touch ~/Applications/Obsidian\ With\ Git\ LFS.app
killall Finder
You can now drag the app to your Dock and launch it like any normal app.
⸻
💡 Why This Works
macOS apps launched from the GUI don’t inherit your shell environment. By wrapping Obsidian in a script and explicitly setting PATH, you restore visibility to git-lfs (and anything else installed outside system paths).
No more pre-push hook errors. No more surprises when you push large files. And it looks and works like a native app.
⸻
🧭 TL;DR
Problem | Fix |
---|---|
Git LFS not found in Obsidian Git | Build a .app wrapper that sets a clean $PATH |
No icon for Automator-style apps | Add Info.plist and obsidian.icns |
GUI apps don’t see shell environment | Use a launch wrapper, not a shell config |
⸻
This fix keeps your Git workflows smooth and protects you from GitHub’s 100MB limit surprises. Launch Obsidian like you always do — but now it Just Works™.