Git Commands

approvedunreviewed

by Dmitry

Run Git commands for the current Obsidian vault.

↓ 9 downloadsUpdated 3d agoMIT

Git Commands

CI GitHub Release License: MIT

A clean, lightweight native Git integration plugin for Obsidian Desktop.

The plugin delegates repository, index, merge, and transport operations directly to your system's installed Git executable. By avoiding bundled JavaScript/Wasm Git reimplementations, it ensures maximum performance, security, and native Git semantics.

Supported desktop platforms: Linux, Windows, and macOS.


Features

  • Status Bar Indicator: Real-time indicator in the Obsidian status bar displaying:
    • Active branch name
    • Working-tree change counts (modified, staged, untracked)
    • Commits ahead of or behind the remote tracking branch
    • Interactive click menu with quick actions
  • Command Palette Actions:
    • Show status: Open an interactive modal displaying changed files and branch sync state
    • Fetch: Fetch remote commits without altering working tree
    • Pull: Pull remote changes from upstream
    • Commit all changes: Stage all vault changes and create a commit
    • Push: Push local commits to the upstream branch
    • Sync: Pull latest remote commits then push local changes
  • Automation:
    • Periodic background fetch (configurable interval; default 30s)
    • Configurable auto-sync interval
  • Customizable Commit Message:
    • Commit message template support with {datetime} timestamp substitution (e.g., vault backup: {datetime})
  • Executable Discovery:
    • Automatic lookup in system PATH and common platform-specific directories (/usr/bin/git, /usr/local/bin/git, Program Files, Homebrew, Xcode command-line tools)
    • Optional custom executable command or absolute path in settings
  • Internationalization (i18n):
    • Automatic language selection matching Obsidian (English and Russian supported, graceful fallback to English)
  • Safe Execution:
    • Non-shell child process execution (execFile) with strict argument arrays to prevent shell injection
    • Terminal interactive prompts disabled (GIT_TERMINAL_PROMPT=0)
    • Configurable process timeouts

Screenshots

Repository Status Modal

Review changed files, staged and unstaged state, and perform one-click commit or sync operations.

Git Repository Status

Status Bar & Quick Actions Menu

View branch and modified file indicators directly in the Obsidian status bar, and click to access the quick actions popup.

Status Bar Menu

Command Palette

Trigger all operations quickly via the standard Obsidian Command Palette.

Command Palette

Plugin Settings

Configure custom Git executable paths, auto-fetch and auto-sync intervals, and commit message templates.

Plugin Settings


Prerequisites

  1. Obsidian Desktop v1.8.7 or newer.
  2. Git installed on your operating system and accessible in PATH (or configured via plugin settings).
  3. Your vault must be inside an initialized Git repository (git init).

Installation

Via BRAT (Beta Reviewer's Auto-update Tester)

  1. Install the BRAT plugin from Obsidian Community Plugins.
  2. Open BRAT settings and click Add Beta plugin.
  3. Enter dimanchello/obsidian-git.
  4. BRAT will automatically download the plugin and keep it updated.

Manual Installation

  1. Go to the Releases page and download the latest release files:
    • main.js
    • manifest.json
    • styles.css
  2. Open your Obsidian vault folder and navigate to .obsidian/plugins/.
  3. Create a new directory named git-commands.
  4. Place main.js, manifest.json, and styles.css into that directory:
    <vault>/.obsidian/plugins/git-commands/
    ├── main.js
    ├── manifest.json
    └── styles.css
    
  5. In Obsidian, go to Settings > Community plugins, click Reload plugins, and enable Git Commands.

Settings

SettingDefaultDescription
Git executable path(empty)Optional path to the git binary. When blank, the plugin searches PATH and standard system locations.
Commit message templatevault backup: {datetime}Commit message format. {datetime} is replaced with the local date and time.
Auto-fetch interval (seconds)30Interval between background fetches. Set to 0 to disable.
Auto-sync interval (minutes)0Interval between background syncs (pull + push). Set to 0 to disable.

Development

Prerequisites

  • Node.js 22+
  • npm 10+

Setup

# Clone the repository
git clone https://github.com/dimanchello/obsidian-git.git
cd obsidian-git

# Install dependencies
npm ci

Scripts

  • npm run dev — Watches source files and compiles in development mode into dist/.
  • npm run build — Typechecks and bundles the plugin into dist/ for production.
  • npm run check — Runs TypeScript typechecking and all unit and integration tests.
  • npm run test:unit — Runs isolated unit tests.
  • npm run test:integration — Runs integration tests against local Git repositories.
  • npm version <patch|minor|major> — Updates version in package.json, manifest.json, and versions.json.

Architecture


License

This project is open source and available under the MIT License.

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.