Docs/Publishing Changes and Resolving Conflicts

Publishing Changes and Resolving Conflicts

What happens when you publish and GitHub has newer changes that overlap with yours, and how the conflict resolver keeps your work safe.

Publishing Changes and Resolving Conflicts

Click Publish (or Publish ▾ › Commit & push in Code mode) when your changes are ready. PhantomStudio first records your work in Git, then pushes it to the current GitHub branch. Publishing your production branch updates your live site; on a draft branch the button reads Save draft and the live site doesn't change. See Publishing Your Site for everything in the Publish menu.

When GitHub has newer changes

Most newer GitHub changes combine automatically. If the same part of a text file changed both locally and on GitHub, publishing pauses with Your commit is saved, but newer changes on GitHub overlap with yours and offers Resolve conflicts.

A common example is changing the site name or another one-line setting in PhantomStudio after GitHub has received a different update to that same line. If the dialog also says No changes to commit, your work may already be safely committed in your workspace. The conflict is preventing that saved commit from being published, not erasing it.

The resolver creates an Automatic recovery copy before changing the repository. This is a permanent local recovery point for the committed work you started with. PhantomStudio does not automatically delete these copies, even after a successful publish.

The wizard has four steps:

  1. Protecting your work creates the recovery copy and loads the latest GitHub version.
  2. Choose what to keep walks through each overlapping change in each supported file.
  3. Review lets you revisit completed files.
  4. Publish checks GitHub once more, combines any newer changes, and pushes the result.

For each overlap, choose:

  • Keep yours: use Your version.
  • Keep GitHub's: use Version on GitHub.
  • Keep both: place your content first, followed by GitHub's content.
  • Edit result: open the complete draft in the code editor after every overlap has a preset choice. Click Save file when you're done.

File-level buttons apply one choice to every overlap in that file. If you change a preset after manually editing the result, PhantomStudio asks before regenerating the draft.

If GitHub changes again

Before every push, PhantomStudio fetches the branch again. If GitHub advanced while you were reviewing, clean changes are combined automatically. New overlaps return you to Choose what to keep with this message:

GitHub changed again while you were reviewing. There are new overlapping changes to check.

Your original automatic recovery copy remains unchanged across every round. If GitHub keeps changing repeatedly, publishing pauses so you can choose Try publishing again instead of looping forever.

Authentication, permission, or network errors do not discard a completed merge. Fix the connection or access problem, then choose Try publishing again.

Stopping or using the terminal

Choose Stop and restore my saved work to end the resolution and return to the original committed work. The automatic recovery copy remains available under Publish ▾ › Versions › Automatic recovery copies.

Open Technical details › Open terminal when you need Git's command line. The wizard minimizes to a persistent Resolution in progress banner (click it to return), and terminal input remains available. On local Docker image 1.20.0 or newer and managed Codespaces infrastructure 1.38.0 or newer, other file, Git, branch, force-pull, and AI mutations stay locked so they cannot race the resolver. Older local containers cannot enforce this lock and instead show the compatibility-mode warning described below.

Terminal changes are authoritative. When you return, PhantomStudio recognizes a merge that was published in the terminal or a merge that was aborted back to the original commit. If the repository is in any other state, automatic actions pause rather than resetting or overwriting it.

Supported files

The guided resolver supports regular UTF-8 text files up to 2 MiB where both versions exist, including multiple overlaps, add/add conflicts, CRLF line endings, and files without a final newline.

Binary files, delete/modify and rename conflicts, symbolic links, file-type changes, submodules, oversized files, and malformed conflict markers require the terminal. If any file is unsupported, PhantomStudio restores the entire original committed state and shows These conflicts need the terminal; it never partially applies a mixed set.

Local Docker image 1.20.0 or newer provides the strongest protection by locking conflicting Git and file actions inside the workspace runtime. Older local containers use a conservative compatibility mode for simple text conflicts through the existing safe Git commands. While that warning is visible, do not edit elsewhere, run AI actions, use another PhantomStudio tab, switch branches, or change the repository in the terminal.

To update the Docker runtime, return to the Dashboard, open the project's ⋯ menu, and choose Update container. The editor's Infrastructure dialog (Help › Developer › Infrastructure in Code mode) can synchronize project-served helper files, but it does not replace or update the Docker image.

Codespaces users can install managed infrastructure 1.38.0 or newer from the update banner.