| 开发者 |
artpi
zieladam |
|---|---|
| 更新时间 | 2026年11月2日 19:31 |
| PHP版本: | 7.2 及以上 |
| WordPress版本: | 7.0 |
| 版权: | GPL-2.0-or-later |
| 版权网址: | 版权信息 |
/wp-json/git/v1/md.git
The repository branch is trunk. Push MD accepts pushes to trunk only.
Users authenticate through WordPress REST authentication. The built-in WordPress Application Passwords feature is the usual Git-over-HTTPS option, and other REST authentication plugins can work when they authenticate the request as a WordPress user before Push MD's permission checks run.
A checkout can include:
post/{slug}.md for posts.page/{slug}.md and page/{parent}/{child}.md for pages.wp_template/{slug}.html and wp_template/{theme}/{slug}.html for templates.wp_template_part/{theme}/{slug}.html for template parts.wp_navigation/{slug}.html for navigation posts.wp_theme/{theme}/theme.json as read-only context.wp_global_styles/{theme}.json for editable Global Styles overlays.wp_knowledge/skills/{slug}/SKILL.md for Knowledge skills and Push MD's built-in agent skills.AGENTS.md, CLAUDE.md, .agents/skills, and .claude/skills for agent guidance when available.title, date, status, and optional description. File paths identify content.
Structural block files use raw Gutenberg block markup with no front matter so they can round-trip through WordPress without being forced into Markdown.
Safety model
Push MD is designed to fail closed. Before applying a push, it validates the changed files across the pushed range. If any file or later commit is unsafe, the whole push is rejected before WordPress content is changed.
Push validation rejects stale remote state, unsupported paths, path traversal, malformed front matter, invalid block markup, invalid Global Styles JSON, and edits to read-only theme JSON.
Deleted post and page files move the matching WordPress content to trash instead of permanently deleting it. Re-adding the same path restores the trashed object instead of creating a duplicate.
Template, template part, navigation, and Global Styles deletes or renames are rejected until reset semantics are explicit.
Try a read-only demo
You can clone the public read-only demo remote before installing Push MD:
git clone https://pushmd.blog/wp-json/git/v1/md.git my-site
That demo lets you inspect the file tree and Markdown shape. Pushes require Push MD on your own authenticated WordPress site.
wp-content/plugins/push-md directory, or install Push MD from the WordPress Plugin Directory.example.com with your site URL:git clone https://example.com/wp-json/git/v1/md.git my-site
Use the trunk branch for pulls and pushes.Yes. Your WordPress database remains authoritative. Git clients read and write through Push MD, so there is no separate content repository to reconcile.
Posts, pages, supported block theme templates, template parts, navigation posts, read-only theme JSON context, Global Styles overlays, WordPress Knowledge when available, and built-in agent guidance.
Use trunk. Push MD rejects pushes to other branches and rejects attempts to delete trunk.
Users must be authenticated and allowed to read the exported repository. Users with broad editorial access can clone the full export; otherwise every exported WordPress object must be readable to that user. This avoids exposing private, draft, pending, or future content through Git history.
Push MD checks permissions for each changed object. Updating, trashing, creating, publishing, scheduling, or making content private requires the matching WordPress capability.
WP-Admin edits become Git-visible on pull. If a local checkout is stale, Push MD rejects the push before writing over newer WordPress content.
Yes. Accepted content updates go through WordPress post APIs and create normal WordPress revisions.
Push MD stores agent skills as WordPress Knowledge. Until Knowledge ships in WordPress Core, the site needs WordPress 7.0+ and Gutenberg 23.6+ with the Guidelines experiment enabled. Push MD detects the complete Knowledge post type and taxonomy; without them, the rest of Push MD continues to work and Knowledge files are omitted. When available, skills appear under wp_knowledge/skills/{slug}/SKILL.md, with generated aliases such as AGENTS.md for agent discovery.
No. Push MD gives you the local-file workflow people like in static site generators, while WordPress still handles previews, rendering, publishing, roles, and revisions.
No. Push MD makes WordPress itself behave like a Git remote for supported content. You can add GitHub, GitLab, Bitbucket, or another host as a separate remote in your local clone if your workflow needs that.
No. The checkout is scoped to supported WordPress content. Theme-provided files such as wp_theme/{theme}/theme.json may appear as read-only context, but Push MD does not deploy theme or plugin code.
No. Media mirroring is planned future work. The current release does not mirror uploads or import attachment binaries.
No. Push MD does not send content to GitHub, Automattic, WordPress.org, or any other third-party service. It exposes a Git endpoint on the WordPress site where the plugin is installed, and authenticated users connect directly to that site's REST API. Authorized clones can include supported content and prior Git revisions. Private, draft, pending, and future content may appear when the authenticated user is allowed to read the full export. Treat clone URLs, Application Passwords, and local clones as sensitive site access.
Uninstalling Push MD removes its Git object-store database tables, seed progress options, transient import lock, and scheduled seed task. It does not delete WordPress posts, pages, templates, navigation posts, Global Styles, Knowledge, or other WordPress content. The removed tables contain Push MD's derived Git repository history. Reinstalling Push MD can seed a new repository from the current WordPress content, but it cannot restore the previous Push MD Git history unless you kept a clone or database backup.