Skip to content

Commit changes from staging

Change a staging or preview site's code over SFTP, SSH, or wp-admin, then commit the changes to its branch with you as the author.

An environment in SFTP mode runs a writable working tree, and its changes are not in Git until you commit them. A commit saves them to the environment's branch: master for staging, and the preview's own name for a preview. For the two modes and how to switch, see Git access.

Live has nothing to commit: its code is a read-only release. See How Git deploys work.

Commit your changes

  1. Pick the environment in the top bar and open Info.
  2. In the Code card, read the files added, changed, and deleted since the last commit, then the line by line changes below them.
  3. Write a short message that says what changed. The message is required.
  4. Click Commit changes. WP Waterfall commits the changes to the branch with you as the author.

To commit only some files, list their paths, one per line. The next commit only sees changes made after the last one. A commit with nothing to commit finishes with no new commit, and the job says so.

When Git refuses a commit for a reason you can fix, such as a path that matches no file, the job log, the API, and the MCP tools show Git's own message, for example fatal: pathspec 'test' did not match any files. Fix what it names and commit again.

Review the changes first

Under the file lists, Review the changes shows what the commit will take. Click a file to open its lines: removed lines on one side of the marker, added lines on the other, with three lines of context.

  • A binary file, such as an image, is listed with no content and no line counts. The commit still includes it.
  • A file that looks like a secret is named, and its content is never read or shown. The commit leaves it out.
  • The view shows at most 50 files, and at most 20,000 bytes of changes for each file. When something is cut, a note says so. The commit still takes every change.
  • If WP Waterfall cannot read the changes, for example because the server needs an update, the card says so and you can still commit.

The same view is available from the API at GET /v1/environments/{id}/working-tree/diff for members who can read code.

What is never committed

Uploads, caches, wp-config.php, the WP Waterfall plugin, and the paths in the ignore: list of wpwaterfall.yml stay out of Git. Files that look like secrets (.env, wp-config-local.php, private keys, database dumps) are left out too, and the card names them. Keep secrets in environment variables.

When the branch moved on

If someone pushed to the branch or merged into it since staging last pulled, WP Waterfall combines your commit with the new commits and staging ends on the result. If the same file changed in both places, nothing changes and WP Waterfall lists the files: resolve the conflict in Git, push, and pull.

Running a read-only release instead

To make the environment read-only again, switch it to Git mode. The dialog asks for a commit message, or for you to tick Discard my uncommitted changes instead. The environment then runs a release of its last commit.

A promote, a merge, and a new branch all build from a commit. When an environment in SFTP mode has uncommitted changes, commit them first, or promote with a commit message (the promote dialog has a field for it). A merge needs both sides clean, or it answers 409 working_tree_dirty.

Backups commit your changes too

Before WP Waterfall takes a backup of an environment in SFTP mode, it commits any uncommitted changes to the branch, as WP Waterfall, with a message that starts "Backup". The backup then records that commit, so its code is always a Git commit. The same exclusions apply as for your own commits. Restoring code adds a new commit and brings the working files to the branch. See Backups.

Getting the code to live

A commit moves code on the branch only. To change live, promote staging. From a preview, merge into staging first.

Still stuck?

Email support at wpwaterfall dot com with your site name and what you tried, or send us a message.