Auto Git Commit

pending

by small

Automatically commit vault changes to git with customizable triggers and templates.

1 starsUpdated 3mo agoMITDiscovered via Obsidian Unofficial Plugins
View on GitHub

Auto Git Commit

English | 中文

A lightweight Obsidian plugin that automatically commits vault changes to git. Desktop only (mobile users can access version history via git web interfaces).

Design Philosophy: This plugin stays minimal and focused. It does one thing well: automatic git commits. No bloat, no complexity—just simple, reliable version control for your notes.

Features

  • Setup Wizard: Guides new users through repository setup based on current state
  • Auto Commit: Automatically commit changes after file modifications (with debounce)
  • Auto Pull: Optionally pull from remote when Obsidian opens
  • Auto Push: Optionally push to remote after commit
  • Manual Operations: Commands for manual pull, commit, and push
  • Ribbon Button: Quick access menu for Git actions (pull, commit, push, revert)
  • File Context Menu: Right-click modified files to revert individual changes
  • Conflict Detection: Detect merge conflicts and pause auto-commit until resolved
  • Git Status Badges: Show colored dots next to modified/new files in file explorer
  • Repository Management: Initialize repo and configure remote URL from settings
  • Custom Template: Configurable commit message with variables
  • File List: Optionally include changed file list in commit body
  • i18n: English and Chinese UI support

Installation

From GitHub Releases (Recommended)

  1. Go to Releases
  2. Download main.js, manifest.json, and styles.css from the latest release
  3. Create folder <vault>/.obsidian/plugins/auto-git-commit/
  4. Copy downloaded files into the folder
  5. Restart Obsidian and enable the plugin in Settings → Community plugins

Build from Source

git clone https://github.com/whtiehack/obsidian-git-auto-commit.git
cd obsidian-git-auto-commit
npm install
npm run build

Then copy main.js, manifest.json, and styles.css to your vault's plugin folder.

Commands

CommandDescription
Commit nowCommit all changes
Commit and pushCommit and push to remote
Pull nowPull from remote
Push nowPush to remote
Mark conflicts as resolvedMark conflicts as resolved (only shown when conflicts exist)

Settings

Automation

OptionDescriptionDefault
Auto pull on openPull from remote when Obsidian opensOff
Commit and push on closeCommit and push when Obsidian closes (may cause brief delay)Off
Enable auto commitAuto commit after file changesOff
Debounce delay (seconds)Wait time before committing30
Auto push after commitPush to remote after commitOff

Configuration

OptionDescriptionDefault
Commit message templateCustom message formatvault backup: {{date}} {{time}}
Include file list in commit bodyList changed files in bodyOn
Show git status in file explorerDisplay colored dots next to changed filesOn
Badge refresh interval (seconds)Detect external git changes. Set to 0 if you only use Obsidian0
Show ribbon buttonAdd Git actions menu to left ribbonOn
Git binary pathPath to git executablegit
Ignore config directoryExclude Obsidian config folder from triggersOn
Debug loggingLog git commands to console (Ctrl+Shift+I to view)Off

Setup (for new users)

The plugin detects your repository state and shows relevant options:

StateDescriptionOptions
Not a repoVault is not a git repositoryConnect to remote / Create new repo / Local only
Empty repoGit initialized but no commitsConnect to remote / Create new repo
Local onlyHas commits but no remoteAdd remote and push
No upstreamRemote configured but no upstream branchSet upstream
ReadyFully configured(Setup section hidden)

Repository

  • Pull: Pull from remote repository
  • Commit: Commit all changes
  • Push: Push to remote repository
  • Remote URL: Configure remote repository URL
  • Initialize: Initialize git repository (if not initialized)
  • Resolve Conflicts: Mark conflicts as resolved (only shown when conflicts exist)

Git Status Badges

Colored dots (●) are displayed next to files in the file explorer:

ColorStatus
Modified YellowModified
Added GreenNew/Added
Conflict RedConflict
Renamed BlueRenamed

Folders show the highest priority status of their contents.

Template Variables

VariableDescriptionExample
{{date}}ISO date2025-12-20
{{time}}Time (HH:MM:SS)10:30:00
{{files}}Changed files (max 5)a.md, b.md, ...
{{count}}Number of changed files3

Requirements

  • Obsidian 1.2.0+
  • Desktop only (Windows / macOS / Linux)
  • Git installed and accessible

Why no mobile support? Mobile platforms lack native Git. While isomorphic-git exists, it has significant limitations: CORS restrictions requiring proxy servers, Buffer compatibility issues, and severe performance problems. For mobile users, we recommend using your git hosting provider's web interface or mobile app (GitHub, GitLab, Gitea, etc.) to view and manage your vault's version history.

License

MIT

For plugin developers

Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.