emdash-plugin-github-backup
Backs up emdash CMS content to a GitHub repo folder on every edit, giving file-based backups and a full git change history.
Automatically backs up emdash CMS content edits to a GitHub repo as commits, turning database changes into a versioned git history.
This project is a plugin for emdash, a content management system that stores its content in a database rather than in git. Normally that means edits made by an editor never show up as file history anywhere. This plugin closes that gap by copying every content change into a GitHub repository, so the repository's commit history becomes a record of who changed what and when.
Whenever a piece of content is created or updated, the plugin writes a JSON file for that entry into a folder in your chosen GitHub repo and commits it. It is smart about not creating duplicate commits: emdash sometimes fires its save event twice for a single edit (once for a draft, once for publishing), so the plugin compares the new content against the last backup and skips the commit if nothing meaningful actually changed. When content is deleted, the corresponding file is removed from the repo, though the old version stays recoverable through git history. If the plugin cannot figure out which file to delete, it writes a small placeholder file instead so the deletion is still logged.
Commits are attributed carefully: by default they are credited to a neutral, no reply GitHub account rather than whichever person's access token was used, which avoids a confusing phantom user showing up in your commit list. When the plugin can identify the actual editor from the content's assigned author field, it will credit that person as the commit author instead.
Setup involves installing the package, adding it to your emdash configuration with a target GitHub owner and repo name, and supplying a GitHub token with write access to that repository, either through settings, environment variables, or plugin options. If the token or repo details are missing, backups are simply skipped and your content save still goes through normally, so a backup problem never blocks an editor from saving work. It also attempts to copy any media files referenced in your content, though this only works when certain conditions are met. This is an independent, unofficial plugin, not built or endorsed by the emdash project itself.
Where it fits
- Keep a version history of CMS content edits stored outside of git.
- Recover a deleted piece of content from a past commit.
- Audit who changed which piece of content and when.