Skip to content

Latest commit

 

History

History
131 lines (92 loc) · 6.92 KB

README.md

File metadata and controls

131 lines (92 loc) · 6.92 KB

Obsidian Git Plugin

A powerful community plugin for Obsidian.md that brings Git integration right into your vault. Automatically commit, pull, push, and see your changes — all within Obsidian.

📚 Documentation

All setup instructions (including mobile), common issues, tips, and advanced configuration can be found in the 📖 full documentation.

👉 Mobile users: Please check the dedicated Mobile section below.

✨ Key Features

  • 🔁 Automatic commit-and-sync (commit, pull, and push) on a schedule.
  • 📥 Auto-pull on Obsidian startup
  • 📂 Submodule support for managing multiple repositories (desktop only and opt-in)
  • 🔧 Source Control View to stage/unstage, commit and diff files - Open it with the Open source control view command.
  • 📜 History View for browsing commit logs and changed files - Open it with the Open history view command.
  • 🔍 Diff View for viewing changes in a file - Open it with the Open diff view command.
  • 🔗 GitHub integration to open files and history in your browser

🧩 For detailed file history, consider pairing this plugin with the Version History Diff plugin.

🖥️ UI Previews

🔧 Source Control View

Manage your file changes directly inside Obsidian like stage/unstage individual files and commit them.

Source Control View

📜 History View

Show the commit history of your repository. The commit message, author, date, and changed files can be shown. Author and date are disabled by default as shown in the screenshot, but can be enabled in the settings.

History View

🔍 Diff View

Compare versions with a clear and concise diff viewer. Open it from the source control view or via the Open diff view command.

Diff View

⚙️ Available Commands

Not exhaustive - these are just some of the most common commands. For a full list, see the Command Palette in Obsidian.

  • 🔄 Changes
    • List changed files: Lists all changes in a modal
    • Open diff view: Open diff view for the current file
    • Stage current file
    • Unstage current file
  • ✅ Commit
    • Commit all changes: Only commits all changes without pushing
    • Commit all changes with specific message: Same as above, but with a custom message
    • Commit staged: Commits only files that have been staged
    • Commit staged with specific message: Same as above, but with a custom message
  • 🔀 Commit-and-sync
    • Commit-and-sync: With default settings, this will commit all changes, pull, and push
    • Commit-and-sync with specific message: Same as above, but with a custom message
    • Commit-and-sync and close: Same as Commit-and-sync, but if running on desktop, will close the Obsidian window. Will not exit Obsidian app on mobile.
  • 🌐 Remote
    • Push, Pull
    • Edit remotes
    • Remove remote
    • Clone an existing remote repo: Opens dialog that will prompt for URL and authentication to clone a remote repo
    • Open file on GitHub: Open the file view of the current file on GitHub in a browser window. Note: only works on desktop
    • Open file history on GitHub: Open the file history of the current file on GitHub in a browser window. Note: only works on desktop
  • 🏠 Manage local repository
    • Initialize a new repo
    • Create new branch
    • Delete branch
    • CAUTION: Delete repository
  • 🧪 Miscellaneous
    • Open source control view: Opens side pane displaying Source control view
    • Edit .gitignore
    • Add file to .gitignore: Add current file to .gitignore

💻 Desktop Notes

🔐 Authentication

Some Git services may require further setup for HTTPS/SSH authentication. Refer to the Authentication Guide

Obsidian on Linux

  • ⚠️ Snap is not supported.
  • ⚠️ Flatpak is not recommended, because it doesn't have access to all system files.
  • ✅ Please use AppImage or a full access installation of your system's package manager instead (Linux installation guide)

📱 Mobile Support (⚠️ Experimental)

The Git implementation on mobile is very unstable! I would not recommend using this plugin on mobile, but try other syncing services.

🧪 The Git plugin works on mobile thanks to isomorphic-git, a JavaScript-based re-implementation of Git - but it comes with serious limitations and issues. It is not possible for an Obsidian plugin to use a native Git installation on Android or iOS.

❌ Mobile Limitations

  • No SSH authentication (isomorphic-git issue)
  • Limited repo size, because of memory restrictions
  • No rebase merge strategy
  • No submodules support

⚠️ Performance Caveats

Caution

Depending on your device and available free RAM, Obsidian may

  • crash on clone/pull
  • create buffer overflow errors
  • run indefinitely.

It's caused by the underlying git implementation on mobile, which is not efficient. I don't know how to fix this. If that's the case for you, I have to admit this plugin won't work for you. So commenting on any issue or creating a new one won't help. I am sorry.

Setup: iPad Pro M1 with a repo of 3000 files reduced from 10000 markdown files

The initial clone took 0m25s. After that, the most time consuming part is to check the whole working directory for file changes. On this setup, checking all files for changes to stage takes 03m40s. Other commands like pull, push and commit are very fast (1-5 seconds).

Tips for Mobile Use:

The fastest way to work on mobile if you have a large repo/vault is to stage individual files and only commit staged files.

🙋 Contact & Credits

  • The Line Authoring feature was developed by GollyTicker, so any questions may be best answered by him.
  • This plugin was initial developed by denolehov. Since March 2021, it's me Vinzent03 who is developing this plugin. That's why the GitHub repository got moved to my account in July 2024.
  • If you have any kind of feedback or questions, feel free to reach out via GitHub issues or vinzent3 on Obsidian Discord server.

☕ Support

If you find this plugin useful and would like to support its development, you can support me on Ko-fi.

ko-fi