README file from
GithubGit File Sync
Git File Sync is a powerful Obsidian plugin that enables seamless synchronization of individual notes with GitLab or GitHub repositories. Unlike full-vault sync solutions, it gives you granular control over what gets pushed and pulled, making it perfect for shared projects, selective backups, and cross-platform workflows.
The Sync Status View provides a clear overview of your files, allowing you to selectively push, pull, or view diffs for modified files.
The Built-in Diff Viewer lets you compare local and remote changes side-by-side before syncing.
Key Features
Selective Synchronization
Don't sync your whole vault. Selectively push or pull individual notes, or use batch operations for specific folders. Perfect for keeping personal notes private while sharing project files.
Visual Sync Dashboard
A comprehensive dashboard provides a bird's-eye view of your vault's status:
- Status Filtering: Instantly see what's modified, new, or missing.
- Visual Diffs: Compare local and remote changes line-by-line before syncing.
- Remote-Only Detection: Identify files existing on GitLab/GitHub that aren't in your vault yet.
Intelligent Conflict Resolution
When versions clash, Git File Sync provides a dedicated diff viewer to help you resolve conflicts manually. Choose the local version, the remote version, or merge them with confidence.
Mobile First
Full support for Obsidian Mobile. Push and pull your notes on the go with a responsive UI designed specifically for touch interfaces.
Installation
From Community Plugins (Recommended)
- Open Obsidian Settings > Community plugins.
- Click Browse and search for
Git File Sync. - Click Install, then Enable.
Manual Installation
- Download the latest
main.js,manifest.json, andstyles.cssfrom the Releases page. - Create a folder named
git-file-syncin<vault>/.obsidian/plugins/. - Copy the downloaded files into that folder.
- Reload Obsidian and enable the plugin.
Configuration
Configure the plugin by selecting your preferred Git service and providing the necessary credentials.
1. Choose Your Service
Go to Settings > Git File Sync and select either GitLab or GitHub.
2. Provider Setup
| Service | Required Info | Scope Needed |
|---|---|---|
| GitLab | Personal Access Token, Project ID, Base URL | api |
| GitHub | Personal Access Token, Owner, Repo Name | repo |
3. Common Settings
- Branch: Specify the target branch (default:
main). - Root Path: Prefix for files in the repository (e.g.,
notes/). - Vault Folder: Limit sync to a specific folder in your vault.
Usage Guide
First-Time Setup
Once configured, you should perform an initial status check:
- Open the Sync Status View by clicking the list icon in the left ribbon or using the Command Palette (
Open sync status view). - Click Refresh status. The plugin will compare your local files with the remote repository.
- Review the file list to see which files are synchronized, modified, or missing.
Daily Workflow: Pushing Changes
When you finish editing a note and want to save it to Git:
- Current Note: Use the cloud icon in the ribbon or the command
Push current file to GitLab/GitHub. - Multiple Notes: Open the Sync Status View, use the Modified filter, select the files you want to sync, and click Push selected.
- Context Menu: Right-click any file in the File Explorer and select
Push to GitLab/GitHub.
Daily Workflow: Pulling Changes
To get the latest updates from other devices:
- Open the Sync Status View and click Refresh status.
- Files with remote updates will show as Modified or Remote only.
- Select these files and click Pull selected.
- Warning: Pulling will overwrite local changes. If there are conflicts, the Conflict Resolution tool will open.
Handling Conflicts
If a file has changed both locally and on the remote server:
- A Conflict Resolution window will appear.
- The left pane shows your Local version, and the right pane shows the Remote version.
- Review the differences.
- Click Keep Local to overwrite the remote version on next push, or Keep Remote to accept the remote changes and overwrite your local file.
Mobile Synchronization
On mobile devices:
- Swipe from the left to access the ribbon and open the Sync Status View.
- Use the Pull action to keep your mobile vault up to date before editing.
- After editing, use the Push action to save your changes back to the repository.
Privacy and Security
- Local Storage: Your Personal Access Tokens (PAT) are stored locally in the plugin's data folder within your vault. They are never sent to any server other than GitLab/GitHub.
- No Telemetry: This plugin does not collect any data or usage analytics.
Development
If you want to contribute or build from source:
# Clone and install
git clone https://github.com/firstsun-dev/git-files-sync.git
npm install
# Development build
npm run dev
# Production build
npm run build
License
This project is licensed under the MIT License.
Created by ClaudiaFang