How to git sync

I’ve already read 1,000 guides and 100 plugins. Nothing worked.

What I’m trying to do

I want to synchronize my vault, which is currently on Windows, on GitHub and then synchronize it on Android. I want the synchronization to happen automatically if it finds any differences. Bidirectional.
I only want to do this with an extension, not with scheduled tasks, partly because there are none on Android.

Things I have tried

  • Git
  • Gitless Sync
  • Ogresync (don’t exist)
  • other that I don’t remember

If your primary goal is to sync between Windows and Android, you might want to forego Git alltogether. Your best best for automatic, continuous, bi-directional sync without tasks is probably going to be SyncThing. It’s not an extension, but it’s a very useful tool. There might be issues if you edit the same file on both devices before they’ve synced, but that’s going to be the case for all tools.

If it needs to be pushed up to GitHub, such as for versioning and backup purposes, then you don’t have many choices. Git doesn’t sync in real-time because that’s not how it was designed to work, and in the situations it was designed for, real-time sync would be a very, very bad thing.

(Edit: Whelp. I didn’t realize Syncthing had been discontinued. RIP, it was wonderful while it existed.)

Syncthing was discontinued in Dec 2024: GitHub - syncthing/syncthing-android: Wrapper of syncthing for Android.

1 Like

To simply back up files to GitHub, I use GitHub - Vinzent03/obsidian-git: Integrate Git version control with automatic commit-and-sync and other advanced features in Obsidian.md which is also available directly in Obsidian plugin page. Then I choose hourly backups because that is fine by me. but you can set the time to be 0.1 minutes for continuous backup but the notifications of the commit and backup happening all the time will get annoying, including when it says ‘nothing to commit’ as you hadn’t typed anything in that time interval.

I wanted the same syncing facility but after I read how difficult android makes syncing via syncthing, and that the developer abandoned the project, I didn’t want to try the alternative that’s still on app store, and just bought Obsidian sync

I tried Vinzent03’s obsidian-git. I couldn’t get it to sync automatically.

It doesn’t necessarily have to sync every second. It just needs to do it every few minutes, when changing tabs, and when Obsidian loses focus.
There is also the possibility that I use Obsidian offline, so synchronization must start when possible.

Git is useful to me because it shows the differences, and I want to avoid deleting pieces by mistake.

The way I got obsidian sync to work was to first set up git in the vault manually. Like I don’t have this extension, i.e. used the command line to git init and connect to a repo, pushed the first commit manually. Only then did I install the extension which just runs the line to commit and sync at your specified time interval.

Did you try this approach?

To save time, I use VSCode in the obsidian directory and use its inbuilt terminal to simplify the manual part.