Fix remote clone retries with existing branches#380
Merged
Conversation
Merged
adamziel
added a commit
that referenced
this pull request
May 18, 2026
## Release `v0.1.47` Version bump and release metadata update for `v0.1.47`. **Changelog draft:** * Fix remote clone retries with existing branches ([#380](#380)) **Full changelog:** v0.1.46...release/v0.1.47 ## Next steps 1. **Review** the changes in this pull request. 2. **Push** any additional edits to this branch (`release/v0.1.47`). 3. **Merge** this pull request to publish `v0.1.47`. Merging will automatically build ForkPress binaries, create a GitHub release, and update the Homebrew formula. Co-authored-by: Codex <codex@openai.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What it does
Makes
forkpress remote clone --branch <branch>behave predictably when the target branch already exists.Without
--force, ForkPress now fails beforersyncor MySQL export/import and tells you to open the existing branch preview or use--force. With--force, ForkPress updates the remote cache and recreates the local branch from that cache.Rationale
A retry after a partial or stale local branch could spend time syncing/importing the remote site and then fail with
branch already exists. That left users looking at the vanillamainbranch fromforkpress init, even though the remote MySQL import had succeeded.The retry path needs to be explicit: refuse early by default, and make
--forcerebuild the local branch from the freshly cloned remote data.Implementation
Added a storage helper for detecting existing COW branches and a recreate cleanup path for branch birth metadata.
remote clone --branchnow preflights COW initialization and branch existence before sync.branch_remote_site()acceptsreplace_existingand deletes/recreates the branch only when the caller passed--force.Docs now call out that
http://wp.localhost:18080/is the localmainbranch, while--branch production-mainpreviews athttp://production-main.wp.localhost:18080/.Testing instructions