Sync your Obsidian vault with Google Drive using OAuth 2.0, with incremental pull/push, conflict handling, selective sync, and offline recovery.
Important
This plugin uses Google Drive scope drive.file.
It can only access files created by this plugin (or explicitly opened with this app scope).
Files created manually in Drive are not guaranteed to appear in sync results.
- OAuth 2.0 authentication
- Setup wizard for account + target folder
- Incremental pull via Google Drive Changes API
- Local file watcher with quiescence-based upload
- Conflict handling for Markdown and binary files
- Activity log view, deleted files modal, and largest files modal
- Version history modal backed by Google Drive revisions
- Selective sync by file type and excluded folders
- Granular
.obsidianconfig sync toggles - Offline queue replay on reconnect
- Rate limiting, quota backoff, and storage-full pause handling
- No hidden telemetry.
- Access token is not persisted.
- Refresh token is stored in plugin data and used only for Google API access.
- OAuth
client IDandclient secretare user-provided Google OAuth credentials. client IDandclient secretare currently stored in plugin settings (device-local) for reuse.- Sync is scoped to the selected Google Drive folder and enabled file types.
Note
A new Keychain settings section for storing plugin secrets is planned. Obsidian Plugin Keychain API support is coming soon. When the API is available, this plugin will move secret storage to Obsidian Keychain.
- External service dependency: Google Drive API and Google OAuth endpoints are required for sync and authentication.
- Account requirement: A Google account and user-provided OAuth client credentials are required.
- Data sent to Google: OAuth tokens, folder/file metadata, and file contents for files selected by sync settings.
- Local data storage: plugin settings, sync database, queue state, and snapshots are stored under
.obsidian/plugins/gdrive-sync/in the current vault. - File access scope: reads and writes only inside the active vault (including selected
.obsidianconfig files). - Telemetry/ads/payments: no analytics telemetry, no ads, and no paywall features.
- Remote code execution: the plugin does not download or execute remote scripts and does not self-update outside normal releases.
- Install BRAT in Obsidian desktop.
- Select Add beta plugin in BRAT.
- Use repository
suho/obsidian-gdrive-plugin. - Install GDrive Sync.
- Build release files:
npm install
npm run build- Create plugin folder:
<Vault>/.obsidian/plugins/gdrive-sync/
- Copy release artifacts into that folder:
main.jsmanifest.jsonstyles.css
- In Obsidian, go to Settings → Community plugins and enable GDrive Sync.
- Open Settings → GDrive Sync.
- Connect your Google account.
- Create or choose a Drive folder for this vault.
- Review initial sync summary and conflicts.
- Run Sync now.
Before using Connect to Google Drive, create a desktop OAuth client in Google Cloud Console:
- Create a Google Cloud project: Project create
- Open credentials page: Credentials
- Enable API: Google Drive API
- Configure consent screen: Branding
- If app is in testing, add your account: Audience
- Create client: OAuth clients
- Choose application type:
Desktop app - Copy
client IDandclient secret, then paste them into the setup wizard.
Mobile auth uses a refresh-token import flow.
- On desktop, copy the refresh token from plugin settings.
- On mobile, paste it into Refresh token. Validation runs automatically.
- Complete folder setup if prompted.
Sync nowPush changesPull changesPause syncResume syncView activity logView conflictsView deleted filesView largest synced filesOpen settingsResume uploads after storage warningClean duplicate sync artifactsForce full re-syncConnect to Google Drive(desktop only)
Force full re-syncis available as both a command and an Advanced settings action.- It clears local sync state, then runs a full local/remote comparison with a preview step.
The plugin uses drive.file, so it primarily sees files created via this plugin. Manual uploads in Drive may be out of scope.
No. Selective sync options (file types, excluded folders, max size, and related behavior) are device-local by design.
Use one shared refresh token for that Google account and OAuth client on the same device:
- Connect the first vault with Connect to Google Drive.
- In each additional vault, open Settings → GDrive Sync and paste the same refresh token. Validation runs automatically.
- Avoid running Connect to Google Drive again unless you intentionally want a new token.
If a vault creates a new refresh token, older vault tokens can be revoked and those vaults will need re-authentication or token re-import.
No. History here is based on Google Drive revisions, not Obsidian Sync snapshots.
- Retention behavior depends on Google Drive revision handling and plugin options.
- Markdown files can optionally request
keepRevisionForever, but retention rules are still Google-side. - History UX and restore semantics are different from Obsidian Sync's native timeline.
No. Only configured categories are synced (for example editor settings, appearance, hotkeys, community plugins). Unsafe and transient files (for example workspace and cache files) are intentionally excluded.
drive.filescope limits visibility to plugin-managed content.- Google API quota limits can temporarily delay sync.
- Files currently active in the editor may be deferred for safety during pulls.
- Mobile platforms can suspend background execution, so sync is best-effort when the app is not foregrounded.
- If setup does not start, run Open settings and reconnect account.
- If re-authentication is required after connecting another vault, paste the latest refresh token in Settings → GDrive Sync and wait for automatic validation, or use Re-authenticate.
- If uploads are paused due to storage full, run Resume uploads after storage warning after freeing space.
- If sync appears stalled, check View activity log for conflict/error entries.
- If local and remote drift after major changes, run Force full re-sync from Settings → GDrive Sync → Advanced.
- If sync metadata seems corrupted, run Force full re-sync to clear local sync state and rebuild sync metadata.
- If the target Drive folder was deleted manually, rerun setup from plugin settings.
- Node.js 18+
- npm
Configure OAuth credentials in the setup wizard:
- On Connect to Google Drive, paste
OAuth client IDandOAuth client secret. - Values are saved in plugin settings, so users only enter them once per device.
- Use a Google OAuth client of type
Desktop appand loopback callback (http://127.0.0.1:<random-port>/callback).
npm install
npm run devnpm run lint
npm run build
wc -c main.jsBundle target: under 200 KB.
- Bump plugin version in
manifest.json,manifest-beta.json, andpackage.json:
# Default: bump minor (x.(y+1).0)
npm run version:bump
# Optional: set explicit version
npm run version:bump -- 0.16.0version:bump also runs npm install to keep package-lock.json in sync.
- Run
npm run versionsto add/update the current plugin version mapping inversions.json. - Add extra supported plugin versions when needed:
npm run versions -- 0.14.1 0.14.2- Optional: add a same-minor patch range:
npm run versions -- --from 0.15.0 --to 0.15.3- Build
main.js. - Create and push a git tag that matches the version in
package.json,manifest.json, andmanifest-beta.json:
npm run release:tagThe script stops without tagging if any of those versions differ.
- Tag a GitHub release exactly as the plugin version (no
vprefix). - Upload
main.js,manifest.json, andstyles.cssas release assets. - Validate against Obsidian policy/guideline checklist in
docs/community-submission-checklist.md.
0BSD