Dmitry Goncharenko3k downloadsTwo-way sync between your vault and a Google Drive folder using the Google Drive API. Works on desktop and mobile.
Two-way sync between an Obsidian vault and a folder in Google Drive, using the Google Drive API directly.
Works on Windows, macOS, Linux, Android, and iPad/iPhone, including mobile devices that can't run Google Drive for Desktop.
Available in Obsidian's Community plugins: community.obsidian.md/plugins/gsync
Like GSync? It's free and open source. You can support development via PayPal.
note (conflict YYYY-MM-DD HHmm).md.Work folder with a folder your team shares.(local edit …) copies instead of failing or overwriting the team's files.GSync is free and complete on its own. GSync Teams is a separate, paid add-on plugin for businesses that keep documentation in Google Drive: it lets GSync sync folders in Shared Drives, and lets you manage who can view or edit each synced folder from inside Obsidian. See GSync Teams below.
Many Google Drive sync plugins expect to own their Drive folder: start from an empty vault, sync only through the plugin, and nothing else may touch the folder. GSync is built for the opposite case. Your notes already live in Google Drive, and you want them on your phone and tablet too.
GSync makes deliberate trade-offs:
accounts.google.com and oauth2.googleapis.com: Google sign-in and refreshing access tokens.www.googleapis.com: the Google Drive API, to list, download, upload, and trash files in the folder you choose.dg0988.github.io (only during sign-in, and only if you keep the default redirect page): a static page in this repository (docs/callback.html) that hands Google's one-time sign-in code back to Obsidian through an obsidian:// link. It has no server-side code and stores nothing. You can host your own copy instead.If a device's vault already lives inside Google Drive for Desktop (e.g. G:\My Drive\...), Drive for Desktop is already syncing it. Don't also run GSync on that device against the same Drive folder, or two sync engines will fight over the same files.
A common setup:
| Device | Vault location | Sync method |
|---|---|---|
| Windows/Mac computer | Inside the Google Drive for Desktop folder | Google Drive for Desktop (GSync off, or auto-sync set to 0) |
| Android phone | Local storage | GSync |
| iPad / iPhone | On My iPad / On My iPhone | GSync |
Also disable any other sync plugin that points at the same folder.
https://dg0988.github.io/ObsidianGSync/callback.html
Copy the Client ID and Client secret.
GSync is published in Obsidian's community directory: community.obsidian.md/plugins/gsync
Updates arrive through Obsidian's built-in plugin updates.
Only needed if you want to test unreleased versions. Install BRAT from Community plugins, then Add beta plugin → dg0988/ObsidianGSync.
Download main.js and manifest.json from the latest release into:
<your vault>/.obsidian/plugins/gsync/
Then fully restart Obsidian and enable GSync under Community plugins. (On iPad/iPhone the Files app hides .obsidian; use BRAT, or an app like a-Shell to create the folder.)
This works the same on desktop, Android, and iOS. As an alternative, you can copy a refresh token from a signed-in device (Copy refresh token) and paste it into Refresh token (manual) on another device.
Set Google Drive folder to the folder's path under My Drive, using / between folders:
Obsidian/Notes
The path must match the Drive folder's name exactly (same spelling and capitalization). If it doesn't exist, it is created.
Start a sync with any of:
First sync on mobile: keep Obsidian open and the screen on until the progress notice disappears. Mobile operating systems pause apps in the background.
| Setting | Default | Description |
|---|---|---|
| OAuth client ID / secret | — | From your Google Cloud Web application OAuth client. |
| Refresh token (manual) | — | Filled in by signing in; or paste one from another device. |
| Sign-in redirect page | https://dg0988.github.io/ObsidianGSync/callback.html |
Must exactly match an authorized redirect URI on your OAuth client. |
| Google Drive folder | Obsidian/<vault name> |
For the whole vault. Path under My Drive. Backslashes are converted to /. |
| More folders | none | Extra vault folders, each with its own Drive folder (see below). |
| Auto-sync every (minutes) | 10 |
0 disables auto-sync. Only runs while Obsidian is open. |
| Sync when Obsidian starts | On | Skipped automatically if the previous sync didn't finish. |
| Sync deletions | On | Off = files deleted on one side come back on the next sync. |
| Max file size (MB) | 25 |
Larger files are skipped and listed. 0 = no limit. Use ~10 on phones. |
| Exclude | desktop.ini, Thumbs.db |
One rule per line (see below). |
| Reset sync state | — | Forgets sync history. The next sync compares every file by content; nothing is deleted. |
| Transfer chunk size (MiB) | 16 |
Android only: how much is sent or received per request. Lower it if a phone runs low on memory. |
| Sync settings and plugins | Off | Settings sync (see below). |
Each extra folder pair links one vault folder with one Drive folder:
| Vault folder | Drive folder | Use |
|---|---|---|
Work |
Company/Team notes |
A folder a colleague shared with you |
Clients |
Shared drives/Acme/Clients |
A folder in a Shared Drive (needs the GSync Teams add-on) |
(local edit …) copy and the Drive version is restored; new files you add stay on your device.Off by default. Turn it on, per device, under Settings → GSync → Plugins and preferences. GSync then syncs the vault's config folder (usually .obsidian) with the folder of the same name inside the whole-vault Drive folder. That's where Google Drive for Desktop already keeps a computer's vault settings, so a phone can take on the computer's setup.
| Toggle | Covers |
|---|---|
| Core settings and hotkeys | app.json, hotkeys.json, core-plugins.json and other settings files |
| Appearance | appearance.json, themes/, snippets/ |
| Enabled plugins list | community-plugins.json |
| Installed plugins | plugins/<plugin>/ (code and settings) |
workspace.json and workspace-mobile.json (each device's window layout), and hidden or node_modules folders.# comments start with #
Templates/ # a folder (prefix) and everything in it
*.exe # a file extension
desktop.ini # an exact file name, anywhere
Notes/draft.md # an exact path
Excluded files stay in Drive and on other devices; they just aren't synced to this one.
GSync remembers what each file looked like on both sides at the last sync:
| Situation | Result |
|---|---|
| Changed locally only | Uploaded |
| Changed in Drive only | Downloaded |
| Changed on both sides | Local keeps the name; Drive version saved as a (conflict …) copy |
| Deleted locally, unchanged in Drive | Moved to Drive trash |
| Deleted in Drive, unchanged locally | Moved to Obsidian trash |
| Deleted on one side, edited on the other | The edit wins; the file is restored |
| Exists on both sides, never synced before | Contents compared (by checksum where Drive provides one); identical files are left alone |
| View-only folder, edited here | Drive version restored; your edit kept as a (local edit …) copy |
Limitations
.) are never synced.| Problem | Fix |
|---|---|
redirect_uri_mismatch |
Your OAuth client must be type Web application, with the redirect page URL added exactly as shown in GSync's settings. |
| Browser doesn't return to Obsidian | Tap Open Obsidian on the page. On Android, allow the browser to open Obsidian if asked. |
| "This sign-in link expired…" | Sign-in must finish within 15 minutes, on the same device where it started. Tap Sign in with Google again. |
"Access blocked" / access_denied |
Add your account as a test user on the consent screen, or publish the app. |
invalid_grant, or sign-in expires every ~7 days |
Publish the OAuth app to In production, then sign in again. |
Drive API 403 on first sync |
Enable the Google Drive API for your project. |
| A new, empty folder appeared in Drive | The folder path doesn't match. Check spelling and capitalization, and use / between folders. Delete the stray folder. |
| "The last sync didn't finish…" | Obsidian closed or crashed mid-sync. Progress was saved; tap Sync now to resume. |
| Obsidian crashes during the first mobile sync | Lower Transfer chunk size to 4 or 1, and leave the app on one note until the sync finishes. |
| "Folders in Shared Drives need the GSync Teams add-on" | Install and activate the GSync Teams add-on. Folders shared with you in My Drive work without it. |
Shared drive "…" not found |
Use the Shared Drive's exact name after Shared drives/, and check that your account is a member. |
| "(local edit …)" files appear | That folder is view-only for you. Ask the folder's owner for Editor access, or move your changes to a folder you own. |
| "Restart Obsidian to apply them" | Settings sync brought new settings or plugins. Restart Obsidian. |
Errors are logged to the developer console (desktop: Ctrl+Shift+I) with the prefix [gsync].
GSync Teams is a separate plugin that works together with GSync. It's for businesses that keep their documentation in Google Drive:
Shared drives/<drive name>/<folder>), so documentation belongs to the business, not to one person's account.GSync does all the syncing either way; the add-on never syncs files itself. Install it from Community plugins (search GSync Teams), or see dg0988/ObsidianGSyncTeams.
.obsidian/plugins/gsync/data.json. Never commit or share that file. The refresh token grants access to your Google Drive.https://www.googleapis.com/auth/drive) so it can see files already in your folder that it didn't create. It only reads and writes inside the folders you configure, and never changes who has access to a folder (only the GSync Teams add-on does that, when you ask it to).npm install
npm run dev # watch build
npm run build # type-check + production build -> main.js
Releases are built and signed by GitHub Actions (.github/workflows/release.yml), so the published main.js has a verifiable build provenance attestation.
version in manifest.json and package.json, and add it to versions.json.1.0.3, no v). Don't attach files: the workflow builds main.js from the tagged source, attests it, and attaches main.js and manifest.json.To verify a downloaded main.js:
gh attestation verify main.js --repo dg0988/ObsidianGSync
GSync is free, open source, and maintained in my spare time. If it saves you a subscription or a headache, you can support development:
Bug reports and feature requests are just as welcome: open an issue.