Convert Figma logo to code with AI

Vinzent03 logoobsidian-git

Integrate Git version control with automatic commit-and-sync and other advanced features in Obsidian.md

8,495
386
8,495
100

Top Related Projects

Integrate Git version control with automatic commit-and-sync and other advanced features in Obsidian.md

Community plugins list, theme list, and releases of Obsidian.

Task management for the Obsidian knowledge base.

Simple calendar widget for Obsidian.

Quick Overview

Obsidian Git is a plugin for the Obsidian note-taking application that integrates Git version control functionality directly into the Obsidian interface. It allows users to manage their Obsidian vault as a Git repository, enabling version control, backup, and synchronization features without leaving the Obsidian environment.

Pros

  • Seamless integration with Obsidian, providing Git functionality within the familiar interface
  • Automated backup and synchronization of notes across multiple devices
  • Customizable commit messages and scheduling options for automatic commits
  • Support for both local and remote Git repositories

Cons

  • Requires basic knowledge of Git concepts for effective use
  • May introduce complexity for users who are not familiar with version control systems
  • Limited to Git functionality; does not support other version control systems
  • Potential for conflicts if manual Git operations are performed outside of Obsidian

Getting Started

  1. Install the Obsidian Git plugin from the Obsidian Community Plugins section.
  2. Enable the plugin in Obsidian settings.
  3. Configure the plugin settings:
    • Set up your Git username and email
    • Choose your preferred backup interval
    • Customize commit message templates
  4. Initialize your Obsidian vault as a Git repository or clone an existing repository.
  5. Use the command palette (Ctrl/Cmd + P) to access Git commands like "Commit all changes" or "Push".

Note: Ensure you have Git installed on your system before using this plugin.

Competitor Comparisons

Integrate Git version control with automatic commit-and-sync and other advanced features in Obsidian.md

Pros of obsidian-git

  • Seamless integration with Obsidian for Git version control
  • Automatic backup and synchronization of Obsidian vaults
  • Customizable commit messages and backup intervals

Cons of obsidian-git

  • Limited to Git-based version control
  • Requires some Git knowledge for advanced usage
  • May have performance impact on larger vaults

Code Comparison

Both repositories contain the same codebase, as they are the same project. Here's a sample from the main plugin file:

export default class ObsidianGit extends Plugin {
    settings: ObsidianGitSettings;
    gitManager: GitManager;
    statusBar: StatusBar;
    private readonly commands: Command[];

    async onload() {
        await this.loadSettings();
        this.addSettingTab(new ObsidianGitSettingsTab(this.app, this));
        // ... (additional code)
    }
}

This code snippet shows the main plugin class structure, including settings management and initialization of Git-related functionality.

Community plugins list, theme list, and releases of Obsidian.

Pros of obsidian-releases

  • Official repository for Obsidian releases, ensuring authenticity and reliability
  • Provides comprehensive release notes and changelogs for each version
  • Serves as a central hub for Obsidian's development progress and feature updates

Cons of obsidian-releases

  • Focused solely on releases, lacking direct integration with Git for version control
  • Does not offer customizable backup and sync options for Obsidian vaults
  • Limited to official Obsidian updates, without community-driven enhancements

Code Comparison

obsidian-releases (release notes example):

## 1.1.16
- Improved PDF export
- Fixed various bugs related to editor and search

obsidian-git (configuration example):

{
  "commitMessage": "vault backup: {{date}}",
  "autoSaveInterval": 0,
  "autoPullInterval": 0,
  "autoPushInterval": 0,
  "pullBeforePush": true
}

The obsidian-releases repository focuses on documenting official releases, while obsidian-git provides active Git integration for Obsidian vaults, allowing users to customize their backup and sync processes. obsidian-releases is essential for staying updated with official Obsidian developments, whereas obsidian-git offers more granular control over version management for individual users.

Task management for the Obsidian knowledge base.

Pros of obsidian-tasks

  • Specialized task management functionality within Obsidian
  • Advanced filtering and sorting options for tasks
  • Supports recurring tasks and due dates

Cons of obsidian-tasks

  • Limited to task management, doesn't offer version control
  • May require more manual input for task creation and management
  • Steeper learning curve for advanced features

Code comparison

obsidian-tasks:

const task = new Task({
  description: "Example task",
  status: Status.TODO,
  dueDate: "2023-05-01"
});

obsidian-git:

const gitManager = new GitManager(vault);
await gitManager.pull();
await gitManager.stage();
await gitManager.commit("Commit message");
await gitManager.push();

The code snippets demonstrate the different focus areas of each plugin. obsidian-tasks is centered around task creation and management, while obsidian-git handles version control operations.

Simple calendar widget for Obsidian.

Pros of obsidian-calendar-plugin

  • Provides a visual calendar interface for managing daily notes and events
  • Offers customizable views (month, week, day) for better organization
  • Integrates seamlessly with Obsidian's daily notes feature

Cons of obsidian-calendar-plugin

  • Limited to calendar-specific functionality, not offering version control
  • May require additional plugins for advanced note management
  • Less suitable for collaborative work or syncing across devices

Code Comparison

obsidian-calendar-plugin:

export default class CalendarPlugin extends Plugin {
  async onload() {
    this.registerView(VIEW_TYPE_CALENDAR, (leaf) => new CalendarView(leaf));
    this.addRibbonIcon("calendar", "Open Calendar", () => {
      this.activateView();
    });
  }
}

obsidian-git:

export default class ObsidianGit extends Plugin {
  async onload() {
    this.addSettingTab(new ObsidianGitSettingsTab(this.app, this));
    this.addCommand({
      id: "pull",
      name: "Pull from remote repository",
      callback: async () => await this.pullChangesFromRemote(),
    });
  }
}

The code snippets show that obsidian-calendar-plugin focuses on creating a calendar view, while obsidian-git implements Git-related functionality like pulling changes from a remote repository.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

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: If files are staged only commits those, otherwise commits only files that have been staged
    • Commit all changes: Commits all changes without pushing
    • Commit all changes with specific message: Same as above, but with a custom message
    • 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