Fetch and prune the preferred remote, then reconcile every local branch
independently. Fast-forward branches that are behind, preserve divergent work,
and delete a branch only when its configured upstream is gone and its commits
are already contained by the remote default branch.
Keep dirty repositories eligible while protecting the active branch and refs
checked out in linked worktrees. Preserve the previous all-clean policy behind
--strict, expose structured per-branch results, add real bare-remote integration
tests, and retain the upstream MIT notice for the adapted hub sync behavior.
Replace POSIX shell-based hub fixtures with a helper executable that resolves
correctly on both Windows and Linux. This prevents Windows tests from falling
through to a real hub.exe and hanging on network access.
Document PowerShell installation and Windows path usage, require the .exe
suffix for explicit Windows build output, and ignore generated binaries.
Walk a workspace for Git repositories, including intentionally nested repos,
while pruning dependency caches and build output directories.
Inspect each branch, remote, operation state, and porcelain status before
running hub sync. Recheck safety immediately before mutation, keep nested
repositories from falsely dirtying their parent, and support concurrency,
exclusions, strict mode, timeouts, JSON output, and explicit confirmation.