Folder Git: one Git repository per folder, with GitHub and Forgejo support

Disclaimer

Is this plugin open source? Yes
Is this plugin completely free? Yes
Is this plugin vibe-coded beyond the author’s ability to comprehend how it works? No
Community Directory: Folder Git


Folder Git lets you keep a separate Git repository for each folder in your vault, instead of treating the whole vault as one repo. You can track as many folders as you like (or the vault root), and each one has its own remote, branch and backup schedule.

I mostly use it for vaults where different folders belong to different projects. A notes folder can go to a private GitHub repo, a shared docs folder to a Codeberg or self-hosted Forgejo repo, and the rest stays out of Git entirely.

What it does:

  • A Source Control panel, a bit like the one in VS Code: stage, unstage, discard (it always asks first), commit, push, pull, sync and fetch, with ahead/behind counts for the current branch.
  • Colored diffs for working and staged changes, and a History view where you can open the diff of any file in a commit.
  • When you add a folder you can create the remote repository from the same dialog, under your account or an organization. Works with GitHub and Forgejo/Gitea.
  • Optional auto-commit per repository, with a message template and auto-push.
  • A small .gitignore editor, plus “Add to / Remove from .gitignore” in the file explorer menu.

Things to know before you try it:

  • Desktop only, and Git has to be installed.
  • No branch UI. It works on whatever branch is checked out, so create or switch branches in a terminal.
  • Merge conflicts you resolve by editing the files; the plugin can only mark them as resolved.
  • History shows the last 50 commits.

On tokens: GitHub/Forgejo tokens are stored in the plugin’s data.json, unencrypted. They are only needed for creating remotes and for pushing/pulling over HTTPS, and SSH remotes don’t need one. A token is only given to the Git process for an https:// remote whose host matches, and it isn’t written to .git/config or the remote URL. If you add the vault root as a repository, the plugin adds its own data.json to the .gitignore so the tokens don’t get committed by accident. The README has a full section on this. The plugin makes no other network requests, and there is no telemetry.

Code is MIT: GitHub - Octadira/obsidian-folder-git

If you run into bugs, or something about the folder-per-repo setup feels off, I’d like to hear it. Issues on GitHub or replies here are both fine.

1 Like

Update: Folder Git 1.3.2

A few releases have gone out since the first post (1.3.2 is now the current one in the Community Directory), and several limitations I listed above no longer apply.

New

  • Branches. Click the branch name to switch. The ⋯ menu and the command palette create, merge and delete branches. Remote-only branches can be checked out as tracking branches.
  • Stash. Stash changes (untracked files included) with an optional note, then apply, pop or delete them from the panel.
  • Amend / undo last commit, with a warning if the commit was already pushed.
  • Conflicts. Keep my version or the incoming version per file, a “merge in progress” banner and Abort merge. Editing the file and marking it resolved still works.
  • History. Older commits load in pages instead of stopping at 50. History of a single file (it follows renames) and “restore this version” of a file from any commit.
  • Status bar with branch, ahead/behind and pending changes. Failed auto-commits and pushes now show up in the panel and the status bar instead of only as a notice.
  • More placeholders for the commit message template: {{time}}, {{repo}}, {{branch}}, {{files}}, in addition to {{date}}.

Also: simple-git is updated to 4.x (it addresses a published advisory), and settings use Obsidian’s declarative settings API on 1.13+.

Still not there: rebase, tags and staging individual hunks. Amending or undoing a commit that was already pushed needs a force push, which the plugin doesn’t do.

So the “Things to know” list in the first post is out of date for branches, conflicts and history. Token handling hasn’t changed (see the README). The full list of changes is in the changelog of the GitHub repo linked in the first post. Bug reports and feedback are welcome here or as GitHub issues.