node-red-contrib-git-control
A Node-RED sidebar plugin for Git version control. Manage commits, branches, merges, and remote synchronization directly from the editor — including flow-aware diff, revert, and merge-conflict resolution that understands flows.json at the node level.

Documentation
| Page | Contents |
|---|---|
| Overview | Installation, requirements, the sidebar tab, and the flow-aware diff, revert and merge |
| HTTP API | Reference of the admin endpoints: authentication, permissions, requests and responses |
The same pages are published at https://docs.rosepetal.ai/flows/node-red-contrib-git-control.
Why you might want it
- Flow-aware merge resolver: When a merge conflicts on
flows.json, the plugin decomposes it into per-tab / per-node 3-way diffs. Take ours, take theirs, or hand-pick per node — no manual JSON surgery. - Flow-aware diff & revert: Diff a single tab or subflow against any commit, and revert one tab (or a specific node) without touching the rest of the flow file.
- Visual commit graph: Branch labels, push status, and parent relationships on a timeline.
- Detached HEAD safety: Auto-branches when committing from historical states to prevent orphaned commits.
- Flow synchronization: Reloads flows after checkout, reset, pull, or merge so the editor stays in sync with disk.
- Conflict / interrupted-op safety net: A persistent banner appears whenever the repo is mid-merge, mid-cherry-pick, mid-revert, or mid-rebase, with an Abort action and, for a merge that conflicts only on
flows.json, a Resolve action. - Smart error messages: Context-aware suggestions guide you through divergence, authentication failures, missing upstreams, etc.
- Integrated workflow: Uses Node-RED's project system and SSH keys — no separate Git configuration needed.
Quick start
Install the plugin in your Node-RED user directory:
bashcd ~/.node-red npm install @rosepetal/node-red-contrib-git-controlRestart Node-RED.
Open the Node-RED editor and look for the Git Control tab in the right sidebar (next to Debug, Config, etc.)
Node-RED 2.0+ with projects enabled is required. The plugin works only with Node-RED project directories that are Git repositories.
Using the sidebar
Toolbar
- Fetch: Download updates from remote without merging
- Pull: Download from remote and merge (reloads flows automatically)
- Push: Upload commits to remote (auto-sets upstream for new branches; offers a 3-way decision — Cancel / Pull / Force push — when the remote has diverged)
- Refresh: Reload all data from repository
Sync indicators show how many commits you are ahead/behind the remote.
Branch picker
Pick a branch from the combo, or open the branch action menu (the icon next to the combo) for:
- Create branch from the current one (to start one at any commit, use Branch here on that commit)
- Create orphan branch
- Merge branch into current (flow-aware resolver kicks in if
flows.jsonconflicts) - Rename branch
- Delete branch
Remote-only branches (not yet checked out locally) appear alongside local branches.
Changes panel
A single list of the modified, created, or deleted files. There is no staging step: Commit stages everything. Under flows.json, the changed tabs / subflows are listed one by one.
The trash icon on a file discards its changes (⚠️ irreversible).
Commit panel
When there are changes: enter a message and click Commit. If you're in detached HEAD (viewing an old commit), the plugin creates a new branch automatically (named from-<hash>) to preserve your work.
Commit graph
Visual timeline:
- Blue nodes: commits already pushed to remote
- Purple nodes: local commits not yet pushed
- Green ring: current HEAD
- Branch labels: which branches point to each commit
Click any commit to expand its details: the branches that contain it, the flows and files it changed, and its actions (checkout, branch here, reset, revert).
Flow-aware diff & revert
The Changes panel (working tree vs the last commit) and a commit's details (the commit vs its parent) show the diff grouped by tab / subflow — each changed node is shown in isolation with its fields before and after. From there you can:
- Revert a whole tab to the last commit's version, or restore it from the chosen commit
- Revert a single node without disturbing the rest of
flows.json
Merge conflict resolver
When a pull or merge produces a conflict in flows.json and in no other file, the conflict-safety banner exposes a Resolve button that opens a 3-way diff modal:
- Bulk choice: "Take ours for all" / "Take theirs for all" (global, wins over per-tab and per-node choices)
- Per-tab choice: "Take ours" / "Take theirs" for an entire tab/subflow
- Per-node choice: pick ours/theirs for individual nodes, with field-level diffs for long values
- Commit message: pre-filled from
.git/MERGE_MSG, editable
The resolver is also fully driveable from outside the UI — see docs/http-api.md for the merge/preview and merge/resolve endpoints.
Detached HEAD warning
If you check out an old commit, a warning banner appears explaining you're in detached HEAD state. Click Return to Latest to go back to your branch tip.
HTTP API
The plugin exposes admin HTTP endpoints for scripting, testing, and external tools (including AI agents). Full reference with request/response examples lives in docs/http-api.md.
Highlights:
| Category | Endpoints |
|---|---|
| Project / status | project-info, status, log, branches, commit-branches |
| Working tree | add, unstage, commit, discard, discard-all, reset |
| Branches | checkout, validate-checkout, create-branch, orphan-branch, delete-branch, rename-branch, set-upstream |
| Remote | fetch, pull, push, force-push |
| History ops | merge, revert, cherry-pick, abort |
| Conflict resolver | merge/preview, merge/resolve |
| Diff | file-diff, commit-diff, flow-diff, flow-units |
| Flow-aware revert | revert-flow-unit, revert-flow-nodes |
| SSH keys | ssh-keys, ssh-key |
All routes require git-control.read or git-control.write permissions when Node-RED admin authentication is enabled. Read endpoints work with a bearer token; mutating endpoints same.