将 Git 版本控制集成到 Obsidian.md,具备自动提交同步及其他高级功能。
AI 翻译
Integrate Git version control with automatic commit-and-sync and other advanced features in Obsidian.md
插件TypeScript · SvelteGitHub @Vinzent03自行安装运营者未确认
试用过了吗? 点一下就好,无需登录。
正在加载完整 README。 以下为已保存的摘录。
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. All setup instructions (including mobile), common issues, tips, and advanced configuration can be found in the 📖 full documentation. Mobile users: The plugin is highly unstable ⚠️ ! Please check the dedicated Mobile section below.查看完整 README ↗
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.
All setup instructions (including mobile), common issues, tips, and advanced configuration can be found in the full documentation.
Mobile users: The plugin is highly unstable. Please check the dedicated Mobile section below.
Open source control view command.Open history view command.Open diff view command.For detailed file history, consider pairing this plugin with the Version History Diff plugin.
Manage your file changes directly inside Obsidian, including staging and unstaging individual files and committing them. The main Commit action commits staged changes when present. The actions menu provides explicit staged-only and all-changes alternatives, plus amending the previous commit on desktop.
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.
Compare versions side by side with highlighted changes. Review, stage, or reset individual hunks without leaving the diff view.
Open it from the source control view or via the Open diff view command.
View line-by-line changes directly in Live Preview with added, modified, and deleted line/hunk indicators. You can stage and reset changes right from the signs. There are also commands to navigate between hunks and stage/reset hunks under the cursor. Needs to be enabled in the plugin settings.
Resolve conflicting changes in Live Preview without leaving your note. Highlighted sections show your version and the incoming version, with buttons to keep ours, theirs, or both. The bar at the top lets you apply a choice to every conflict in the file. Source Control lists conflicted files and shows how many conflict blocks remain.
When Git includes the common ancestor (for example, with merge.conflictStyle=diff3), you can also compare and keep the base version.
After reviewing the result, mark the file as resolved in Source Control, then commit to finish the merge. See the conflict resolution guide for the full workflow.
Not exhaustive - these are just some of the most common commands. For a full list, see the Command Palette in Obsidian.
List changed files: Lists all changes in a modalOpen diff view: Open diff view for the current fileStage current fileUnstage current fileDiscard all changes: Discard all changes in the repositoryCommit: Commits staged changes when present. If nothing is staged, either stages and commits all changes or stops, depending on the Stage all changes when nothing is staged settingCommit with specific message: Same as above, but with a custom messageCommit all changes: Commits all changes without pushingCommit all changes with specific message: Same as above, but with a custom messageCommit-and-sync: With default settings, this will commit all changes, pull, and pushCommit-and-sync with specific message: Same as above, but with a custom messageCommit-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.Push, PullEdit remotes: Add new remotes or edit existing remotesRemove remoteClone an existing remote repo: Opens dialog that will prompt for URL and authentication to clone a remote repoOpen file on GitHub: Open the file view of the current file on GitHub in a browser window. Note: only works on desktopOpen file history on GitHub: Open the file history of the current file on GitHub in a browser window. Note: only works on desktopInitialize a new repoCreate new branchDelete branchCAUTION: Delete repositoryOpen source control view: Opens side pane displaying Source control viewOpen history view: Opens side pane displaying The Obsidian community scorecard reports automated code checks, including warnings about shell execution and direct filesystem access. On desktop, this plugin needs those capabilities to run your installed Git and work with repository metadata and Git configuration beyond Obsidian's vault API. These requirements contribute to the Review rating, so read it alongside the individual findings and in the context of native Git integration.
Some Git services may require further setup for HTTPS/SSH authentication. Refer to the Authentication Guide
The Git implementation on mobile is very unstable! I would not recommend using this plugin on mobile, but try other syncing services.
One such alternative is GitSync, which is available on both Android and iOS. It is not associated with this plugin, but it may be a better option for mobile users. A tutorial for setting it up can be found here.
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.
[!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.
If you have a large repo/vault I recommend staging individual files and setting automatic commit globs to Include matches with an empty list, so automatic commits use only staged files.
If you find this plugin useful and would like to support its development, you can support me on Ko-fi.
Edit .gitignoreAdd file to .gitignore: Add current file to .gitignore