Sync to Git Remote
What's it for?
This plugin allows you to synchronize all folders, notes and resources to a local folder, and synchronize it to an external repository such as Github, Gitlab, Bitbucket, etc.
Why this plugin
I needed to make additional backups, in addition to the initial sync, in order to secure data persistence, and to be able to view my notes outside Joplin if necessary.
The source of truth remains what is on Joplin, through native synchronization, because Git merge conflicts may occur without being resolvable.
This is why, during sync with this plugin, first a Joplin sync is executed, then a forced push to the remote repository.
Configuration
How does the plugin work?
- Performs a native sync to Joplin if configured (Joplin Cloud, Dropbox or OneDrive), in order to recover any changes that may have been made on other devices or by other people.
- Create a local folder if it doesn't already exist
- Deletes all the contents of this local folder
- If git is not initialized in the folder
- If no repository is configured in the module configuration, initialize git with the configured branch
- If a repository is configured, git clone remote content from the configured branch
- Export all folders, notes and resources to folder
- Commit all
- If remote is configured, push to remote repo on relevant branch
If you encounter any problems, have suggestions for improvement, or any other request, please let me know.