Skip to content

relizy / assertBranchUpToDateWithRemote

Function: assertBranchUpToDateWithRemote() ​

assertBranchUpToDateWithRemote(__namedParameters): Promise<void>

Defined in: src/core/git.ts:413

Ensure the current branch contains every commit of its remote counterpart.

A release commit created on a branch that is behind its remote can never be pushed. Since packages are published before the push, running this check right before publishing prevents shipping a version whose release commit is then rejected (leaving an orphan tag and the repository stuck on the previous version).

Skipped (no error) on a detached HEAD, without upstream, or when the remote cannot be fetched.

Parameters ​

__namedParameters ​

cwd ​

string

Returns ​

Promise<void>

Released under the MIT License.