Search...Search plugins and themes...
⌘K
Sign in
  • Get started
  • Download
  • Pricing
  • Enterprise
  • Account
  • Obsidian
  • Overview
  • Sync
  • Publish
  • Canvas
  • Mobile
  • Web Clipper
  • CLI
  • Learn
  • Help
  • Developers
  • Changelog
  • About
  • Roadmap
  • Blog
  • Resources
  • System status
  • License overview
  • Terms of service
  • Privacy policy
  • Security
  • Community
  • Plugins
  • Themes
  • Discord
  • Forum / 中文论坛
  • Merch store
  • Brand guidelines
Follow us
DiscordTwitterBlueskyThreadsMastodonYouTubeGitHub
© 2026 Obsidian

Auto GitKeep

SATOSprodSATOSprod58 downloads

Automatically places a .gitkeep file in every folder of your vault so empty directories are tracked by Git. Scans existing folders on load and watches for new ones.

Add to Obsidian
  • Overview
  • Scorecard
  • Updates4

Obsidian plugin that automatically places a .gitkeep file in every folder of your vault so empty directories are tracked by Git.

Author: SATOSprod
License: Proprietary — see LICENSE


Why .gitkeep?

Git does not track empty directories. If your vault has folders with no files — or folders that become empty after a .gitignore rule — those folders simply disappear when someone clones the repository. A .gitkeep is a zero-byte placeholder that forces Git to include the directory.


Features

  • Auto scan on startup — when the plugin loads, it scans the entire vault and adds .gitkeep to every folder that is missing one
  • Watcher — when a new folder is created (or renamed), .gitkeep is added automatically
  • Exclude paths — configure a list of folders to skip (.obsidian, .trash, etc.)
  • Manual actions — two on-demand buttons in settings:
    • Add .gitkeep to all folders — full vault scan, safe to run multiple times
    • Remove all .gitkeep — cleans up every .gitkeep from the vault
  • Status panel — live counter: total folders, excluded folders, .gitkeep files present
  • SVG icons, no emoji — consistent with the SATOSprod plugin style

Requirements

  • Obsidian 1.7.2 or later
  • Works on desktop and mobile

Installation

From source

# 1. Clone the repository
git clone https://github.com/SATOSprod/auto-gitkeep.git
cd auto-gitkeep

# 2. Install dependencies
npm install

# 3. Build
npm run build
# Produces: main.js

Copy the following files into your vault:

<your-vault>/.obsidian/plugins/auto-gitkeep/
├── main.js          ← compiled output
├── manifest.json
└── styles.css

Open Obsidian → Settings → Community plugins → Installed plugins and enable Auto GitKeep.

Development mode (auto-rebuild on save)

npm run dev

Configuration

Open Settings → Auto GitKeep.

Auto GitKeep toggle

State Behaviour
On Scans vault on startup; watches for new/renamed folders and adds .gitkeep immediately
Off Watcher is paused; manual action buttons still work

Excluded paths

One vault-relative path per line. Subdirectories are excluded automatically.

Default exclusions:

.obsidian
.trash

You can add any folder you do not want .gitkeep files in, for example:

.obsidian
.trash
assets/cache
node_modules

Manual Actions

Both buttons are available in the settings panel regardless of the auto toggle state.

Button Description
Add .gitkeep to all folders Scans the entire vault and creates .gitkeep in every folder that does not already have one. Respects excluded paths. Safe to run multiple times — existing files are not touched.
Remove all .gitkeep Deletes every .gitkeep file from every folder in the vault.

Status Panel

The bottom of the settings page shows a live summary:

Field Description
Auto mode Whether the watcher is currently enabled
Total folders Number of folders in the vault
Excluded folders Folders skipped by the excluded paths list
.gitkeep files present How many folders currently have a .gitkeep

File Structure

auto-gitkeep/
├── main.ts               ← TypeScript source
├── main.js               ← compiled output (gitignored, built locally)
├── styles.css            ← plugin styles
├── manifest.json         ← Obsidian plugin manifest
├── package.json
├── tsconfig.json
├── esbuild.config.mjs
├── versions.json
├── .gitignore
├── LICENSE
└── README.md

How It Works

  1. On load, the plugin calls onLayoutReady and iterates every TFolder in the vault via Obsidian's file system API, creating .gitkeep where missing.
  2. It registers a listener on the vault.on("create") event — when Obsidian creates a TFolder, .gitkeep is added to it.
  3. A listener on vault.on("rename") handles folder renames — the new path also gets .gitkeep.
  4. All file operations go through app.vault so they are compatible with both local vaults and sync services.

License

This project is released under a proprietary license.
Copying source code into other projects is not permitted.
See LICENSE for full terms.

© 2026 SATOSprod

HealthExcellent
ReviewPassed
About
Add .gitkeep files to every folder to keep empty directories tracked by Git and preserved when cloning. Scan the vault on startup, watch new or renamed folders, respect excluded paths, and provide manual add/remove actions plus a status panel showing folders and .gitkeep counts.
GitFoldersAutomation
Details
Current version
1.1.2
Last updated
3 weeks ago
Created
4 weeks ago
Updates
4 releases
Downloads
58
Compatible with
Obsidian 1.7.2+
Platforms
Desktop, Mobile
License
MIT
Report bugRequest featureReport plugin
Author
SATOSprodSATOSprodsatosprod
GitHubsatosprod
  1. Community
  2. Plugins
  3. Git
  4. Auto GitKeep

Related plugins

Waypoint

Easily generate dynamic MOCs in your folder notes using waypoints. Enables folders to show up in the graph view and removes the need for messy tags!

Auto Note Mover

Automatically move the active notes to their respective folders according to rules you set.

Default Template

Automatically apply templates to new notes with user-configurable template selection.

Homepage

Open a note, base, or workspace on startup, or set it for quick access later.

BRAT

Easily install a beta version of a plugin for testing.

Advanced URI

Control everything with URI.

Lazy Loader

Load plugins with a delay on startup, so that you can get your app startup down into the sub-second loading time.

Git

Integrate Git version control with automatic backup and other advanced features.

Hot Reload

Automatically reload in-development plugins when their files are changed

Multi Properties

Add properties to multiple notes at once. Either right-click a folder or select multiple notes and right-click the selection.