jdx/mise · error

global configuration at

Error message

global configuration at {shown} cannot be fast-forwarded to the transferred revision

What it means

In a dry-run update of an existing global-configuration checkout, mise checks whether the destination's current HEAD is an ancestor of the transferred revision (a fast-forward). If HEAD has diverged — it contains commits not present in the transferred history — a `--ff-only` merge would fail, so mise reports the situation up front instead of attempting it.

Solutions

  1. Push the destination's local commits to the source repository and re-transfer, so the revision includes them.
  2. Rebase the destination onto the transferred revision manually, then retry (HEAD will then be an ancestor).
  3. If the local commits are disposable, hard-reset the destination to the remote branch: `git -C <destination> reset --hard origin/<branch>`.
  4. Inspect the divergence with `git -C <destination> log --oneline origin/<branch>..HEAD` before deciding.

Example fix

// before: destination has diverged
$ git -C ~/.config/mise log --oneline origin/main..HEAD
a1b2c3d local tweak

// after: push the commit so the transferred revision contains it
$ git -C ~/.config/mise push origin HEAD:main
// then re-package the bundle and retry the install
Defensive patterns

Strategy: validation

Validate before calling

const head = execSync(`git -C ${dest} rev-parse HEAD`).toString().trim();
const diverged = execSync(`git -C ${dest} log --oneline origin/${branch}..HEAD`).toString().trim();
if (diverged) throw new Error('destination has local commits not in the transferred revision: ' + diverged);

Try / catch

try {
  await installSource(bundle, origin, { update: true, dryRun: true });
} catch (e) {
  if (/cannot be fast-forwarded/.test(String(e.cause ?? e))) {
    console.error('push or rebase local commits in ' + dest + ' before updating');
  }
  throw e;
}

Prevention

When it happens

Trigger: install/install_source/preview_source (install_at) with update and dry_run enabled where `git merge-base --is-ancestor <dest-HEAD> <revision>` fails, i.e. the destination has local commits that were rebased, amended, or never pushed to the transferred repository.

Common situations: Local commits made directly in the destination checkout that were never pushed; history was rewritten upstream (force-push/rebase) so old commits are no longer ancestors; onboarding a machine whose checkout is ahead of the shared repo.

Understand the failure class

Background: "Invalid state transition" errors: "status must be X, actually Y", "already rejected/charging/uninstalled", "cannot ... while running" — what they mean when a library rejects your call — this error's family across 31 libraries.

Related errors


AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17). Data as JSON: /api/errors/b01be4ac544a5e8a. Report an issue: GitHub.

Appendix: source

Thrown at src/system/remote_repository.rs:276

        }
        if update {
            if git(destination, &["symbolic-ref", "--short", "HEAD"])? != branch {
                bail!("global configuration branch differs from the transferred branch");
            }
            if dry_run {
                // the bundle holds the history from the checkout's commit on,
                // so the fast-forward is checked there without fetching into
                // the destination
                let head = git(destination, &["rev-parse", "HEAD"])?;
                if head == revision {
                    miseprintln!(
                        "Would keep {shown} at {revision}, already the transferred revision"
                    );
                } else if git(&checkout, &["merge-base", "--is-ancestor", &head, revision]).is_ok()
                {
                    miseprintln!("Would fast-forward {shown} from {head} to {revision}");
                } else {
                    bail!(
                        "global configuration at {shown} cannot be fast-forwarded to the transferred revision"
                    );
                }
                return Ok(destination.to_path_buf());
            }
            git(
                destination,
                &[
                    "fetch",
                    "--no-tags",
                    bundle
                        .to_str()
                        .ok_or_else(|| eyre::eyre!("invalid bundle path"))?,
                    "HEAD",
                ],
            )?;
            git(
                destination,

View on GitHub (pinned to 533346cc37)