Git for Plex Stored Procedures

Updated Sep 13, 2026
DataMagik Automate

Git for Plex Stored Procedures

Plex stored procedures live in Plex, not in DataMagik — so this works from inside Plex, through the browser extension.

Open a stored procedure in Plex's SQL development screen with the DataMagik browser extension installed and signed in. The DataMagik panel gains a Git section, and everything happens there: choosing a repository, picking a folder and file, switching or creating a branch, committing, and pulling. You do not need to visit the DataMagik website to set any of that up.

Requirements. The browser extension, signed in to DataMagik; a repository connection already configured by a Builder; and your own access token. Both of those are set up on your DataMagik profile — Settings → Git Access Tokens — see Setting Up a Git Connection.

Until a repository exists, the panel says so plainly: "No git repository is set up for your account yet. Add one in DataMagik under Script Engine → Git, then come back." That link and the profile card open the same page.

Open the Properties tab first

Before you can match a procedure, the panel asks you to open Plex's Properties tab for it. That is not busywork — the panel reads the procedure's System Name from there, the read-only one, rather than the editable display name.

This matters because the System Name is what identifies the procedure in git. If the file were keyed on the editable name, renaming the procedure in Plex would silently start a second file beside the first and its history would split in two. Keyed on the System Name, a rename is just a rename.

Matching a procedure to a file

  1. Open the procedure in Plex, and open its Properties tab.
  2. In the DataMagik panel, choose Use this stored procedure.
  3. Pick the repository, then the branch.
  4. Browse to a folder — click into folders, use the up control to go back.
  5. Accept the suggested file name or type your own, and save the match.

The panel follows the procedure you have open: switch to a different one in Plex and it re-reads everything for that one, so the buttons never act on the procedure you were looking at a moment ago.

Committing and pulling

Committing shows you the SQL that is about to be written before you confirm it, along with the branch and path it is going to. Everything is typed in the panel itself — branch names, folder names, commit messages — with no browser pop-up boxes anywhere in the flow.

Pull works the way it does everywhere else: it reports what the repository holds and asks before replacing what is in the Plex editor. If you accept, you still need to save the procedure in Plex for the change to take effect — DataMagik writes into the editor, not into Plex's database.

Branches

Switch branches from the panel, or create one from the branch you are on. Your working branch is stored per person, so changing it does not affect colleagues. A feature branch plus a pull request is the usual way to get a procedure reviewed before it reaches your default branch.

The same protections apply

  • A changed file is refused, not merged. If the file moved in the repository since the panel last read it, the commit is rejected and nothing is written.
  • Committing the same content twice reports no change rather than an error.
  • A commit is attributed to you, using your own access token.

If something goes wrong

  • You are asked to sign in — the extension's DataMagik session has expired; sign in and try again.
  • "No git repository is set up for your account yet" — nobody has added a repository connection yet, or yours is inactive. See Setting Up a Git Connection.
  • "DataMagik is not reachable right now" — a network or service problem between your browser and DataMagik. Nothing was committed; try again shortly.
  • "The git host rejected the credential" — your access token is wrong, expired, or lacks access. Fix it on your profile under Settings → Git Access Tokens.
  • The panel keeps asking for the Properties tab — Plex has not rendered the System Name yet. Open the Properties tab and let it load.

Next steps

Was this page helpful?