Git Subbridge

by zhu
5
4
3
2
1
Score: 46/100

Description

A customized Git plugin for Obsidian that solves the nested sub-repository upload problem.

Reviews

No reviews yet.

Stats

0
stars
62
downloads
0
forks
56
days
7
days
51
days
22
total PRs
6
open PRs
16
closed PRs
0
merged PRs
0
total issues
0
open issues
0
closed issues
14
commits

Latest Version

2 months ago

Changelog

Release 1.0.7 of Git Subbridge.

README file from

Github

Git Subbridge

English | 简体中文

A customized Git plugin for Obsidian that solves the problem of uploading or committing nested sub-repositories.

Features

  • Adds a Sub-git scan button to the Source Control toolbar, immediately to the left of Commit-and-sync.
  • Scans the repository for child folders containing .git.
  • Supports Exclusive rename mode, which keeps only .git or .git_metadata.
  • Supports Sidecar copy mode, which keeps both directories and avoids Windows directory-lock errors.
  • Adds a Nested repositories settings section with bridge, metadata-mode, and language options.
  • Language: 中文 translates the settings page and adds Chinese translations to button tooltips.
  • Writes a recovery journal so interrupted operations can be restored on the next startup.

How it works

In Exclusive rename mode, .git is renamed to .git_metadata before the commit and renamed back afterward. In Sidecar copy mode, only .git/HEAD is temporarily renamed, the metadata is copied to .git_metadata, and both directories remain.

Scan child .git
    -> rename .git/HEAD to HEAD__subbridge
    -> copy .git to .git_metadata
    -> stage and commit with Obsidian Git
    -> restore .git/HEAD

The bridge currently covers the Commit all path used by Commit all and the default Commit-and-sync action. Staged-only commits are not automatically bridged.

For a detailed comparison, see Metadata modes.

Build and install

pnpm install --frozen-lockfile
pnpm run build

Copy main.js, manifest.json, and styles.css into:

.obsidian/plugins/git-subbridge/

Then enable Git Subbridge in Obsidian. Disable the original Git plugin while using this plugin so both plugins do not operate on the same repository at the same time.

Usage

  1. Open the Source Control view.
  2. Click the Sub-git scan button to check for child Git repositories.
  3. Run Commit all or Commit-and-sync.
  4. The plugin bridges child .git folders, commits the parent repository, and restores the original folder names.

Safety notes

  • This plugin is desktop-only and currently intended for Windows.
  • Do not run Git commands inside a child repository while it is being bridged.
  • Keep enough free disk space for Git index metadata and recovery operations.
  • Do not run Git commands inside a child repository while Commit-and-sync is preparing or restoring it.

Author

License

This project is distributed under the MIT License. See LICENSE.