{"id":25080257,"url":"https://github.com/davhofer/obsidian-sync","last_synced_at":"2026-04-27T22:32:49.235Z","repository":{"id":222207686,"uuid":"756583393","full_name":"davhofer/obsidian-sync","owner":"davhofer","description":"Utitlities for syncing obsidian notes between different devices, e.g. desktop and mobile (android)","archived":false,"fork":false,"pushed_at":"2024-02-12T22:46:43.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-09T09:44:45.976Z","etag":null,"topics":["notes","obsidian","syncing"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/davhofer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-02-12T22:19:38.000Z","updated_at":"2024-02-12T22:48:34.000Z","dependencies_parsed_at":"2024-02-12T23:49:31.264Z","dependency_job_id":null,"html_url":"https://github.com/davhofer/obsidian-sync","commit_stats":null,"previous_names":["davhofer/obsidian-sync"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/davhofer/obsidian-sync","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davhofer%2Fobsidian-sync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davhofer%2Fobsidian-sync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davhofer%2Fobsidian-sync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davhofer%2Fobsidian-sync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davhofer","download_url":"https://codeload.github.com/davhofer/obsidian-sync/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davhofer%2Fobsidian-sync/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32358509,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T20:07:02.737Z","status":"ssl_error","status_checked_at":"2026-04-27T20:07:00.910Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["notes","obsidian","syncing"],"created_at":"2025-02-07T03:18:59.072Z","updated_at":"2026-04-27T22:32:49.219Z","avatar_url":"https://github.com/davhofer.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# obsidian-sync\nUtitlities for syncing obsidian notes between different devices, e.g. desktop and mobile (android).  \nNotes are synced using a github remote repository. Each client queries the remote to get the latest changes when notes are being viewed, and pushes changes after files have been edited.\n\nThe basic assumptions here are that there is only a single user using those different clients, e.g. files aren't edited at the same time on different devices, and that the user won't switch between using one and then another device in a super short timespan, e.g. less than 5 minutes.\n\nThe idea is to use the `inotifywait` utility to check whether the vault or any file in it is either being opened or being edited, which allows for taking the appropriate action. When files have been opened, we simply `git pull` (as long as we didn't just do it already in the last few minutes). When files are being edited, we start a timer for X seconds (e.g. 30-60) and after that time commit \u0026 push to the remote, assuming that once a user starts typing they will do so for at least a short period of time and we don't want to create too many commits.  \nImmediately after pulling/pushing, we listen again for events using `inotifywait`.  \n\nNote that it might make sense to gitignore config files in `.obsidian`, depending on your preferences.\n\n## Desktop (Linux)\nOn linux, the two bash scripts (one for the loading/pulling, one for the saving/pushing) can simply be started after reboot using cron jobs. Make sure to set up ssh keys for github such that the git commands complete without problems.\n\n## Mobile (Android)\nThe setup for android is slightly more involved. In order to get git running on android, you can download the Termux app (https://termux.dev/en/) from F-Droid. With Termux you can then install (if not already installed) inotify utilities, git as well as setup local ssh keys, and use a similar setup as on linux. Instead of cron jobs, the jobs can be started by placing a bash file in the termux startup folder `/data/data/com.termux/files/usr/etc/profile.d/`, calling the two scripts asynchronously.\nThe only remaining thing to do is to make sure that termux is started automatically on boot. Apparently you can use the app MacroDroid for that, however this did not work reliably for me.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavhofer%2Fobsidian-sync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavhofer%2Fobsidian-sync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavhofer%2Fobsidian-sync/lists"}