jdx/mise · error
this machine is connected to
Error message
this machine is connected to {url}; `mise dot origin --remove` disconnects it, or `mise dot origin set {origin}` moves it What it means
mise's history sync refuses to proceed when the machine's sync state already points at a different origin repository or branch and has not been explicitly disconnected. It names the conflicting URL and tells the user how to disconnect (`mise dot origin --remove`) or move the connection (`mise dot origin set {origin}`). This guard prevents silently rebinding history sync to another repository.
Solutions
- Run `mise dot origin --remove` to disconnect the current origin, then reconnect
- Run `mise dot origin set {origin}` to move the connection to the new origin
- Delete or reset the sync state in the store's state dir if it is stale
Defensive patterns
Strategy: validation
Validate before calling
let status = read_status(state_dir)?;
if let Some(url) = &status.origin_url && !status.disconnected && url != desired_origin {
eprintln!("run `mise dot origin --remove` first (connected to {url})");
return;
} Prevention
- Check connection state with the status command before setting a new origin
- Disconnect explicitly when moving machines between repositories
- Treat 'origin already set' warnings as needing an explicit decision, not an auto-overwrite
When it happens
Trigger: Running `mise dot origin set` or onboarding-from-git (from_git -> run) while the persisted status in the store's state dir has an origin_url that differs from the requested origin/branch, and `disconnected` is false.
Common situations: Repointing a machine at a fork or new remote without removing the old connection; cloning the same repo to a second branch; a leftover sync state from a previous repository after `git remote set-url`.
Understand the failure class
Background: Conflicting config options: "cannot be used together" — configuration validation errors across open-source libraries — this error's family across 162 libraries.
Related errors
- cannot replace local history while
- enrollment conflict in
- repository application paused: reconcile repository…
- sync paused: resolve conflicts across the complete…
- cannot check staged changes: git is unavailable
AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17).
Data as JSON: /api/errors/d02a5acdb96bfb5c.
Report an issue: GitHub.
Appendix: source
Thrown at src/system/history/sync/onboard.rs:217
if refs.iter().any(|(_, name)| name == candidate) {
return Ok(Some(
candidate.trim_start_matches("refs/heads/").to_string(),
));
}
}
Ok(refs
.iter()
.find_map(|(_, name)| name.strip_prefix("refs/heads/").map(str::to_string)))
}
/// A machine connected to another repository is not silently moved.
fn refuse_other_connection(store: &Store, origin: &str, branch: &str) -> Result<()> {
let status = run::read_status(store.state_dir())?;
if let Some(url) = &status.origin_url
&& !status.disconnected
&& (url != origin || status.origin_branch.as_deref() != Some(branch))
{
bail!(
"this machine is connected to {url}; `mise dot origin --remove` disconnects it, or `mise dot origin set {origin}` moves it"
);
}
Ok(())
}
/// Fetches the branch into the store and says what the repository is. A
/// format this mise does not understand is an error; an ordinary
/// repository leaves nothing behind.
fn probe(store: &Store, fetch_from: &str, branch: &str) -> Result<RepoState> {
let repo = store
.repo()
.ok_or_else(|| eyre::eyre!("probing a setup repository requires git"))?;
Remote::new(repo, fetch_from).fetch_tip(branch)?;
let upstream = repo.ref_oid(UPSTREAM_REF)?;
let state = format::detect(repo, upstream.as_deref())?;
state.check()?;
if !matches!(state, RepoState::Marked(_)) && upstream.is_some() {View on GitHub (pinned to 533346cc37)