{"record":{"id":"555170ae639dba43","repo":"jdx/mise","slug":"the-setup-branch-is-not-at-any-more-renamed-or-deleted","errorCode":null,"errorMessage":"the setup branch `{}` is not at {} any more (renamed, or deleted?); nothing was changed. `mise dot origin set {} --branch <name>` follows a renamed branch","messagePattern":"the setup branch `(.+?)` is not at (.+?) any more \\(renamed, or deleted\\?\\); nothing was changed\\. `mise dot origin set (.+?) --branch <name>` follows a renamed branch","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/history/sync/run.rs","lineNumber":270,"sourceCode":"        .ok_or_else(|| eyre::eyre!(\"synchronizing requires git\"))?;\n    let mode = SyncMode::current()?;\n    let allow_plaintext_history = request.allow_plaintext_history\n        || crate::config::Settings::get()\n            .history\n            .allow_plaintext_history;\n    let state_dir = store.state_dir();\n    let mut status = read_status(state_dir)?;\n    let remote = Remote::new(repo, &origin.url);\n    let mut outcome = SyncOutcome::default();\n\n    let result = (|| -> Result<()> {\n        if !request.offline {\n            // a branch that vanished from a repository this machine had\n            // synced with is not an empty upstream: reading it as one would\n            // queue the deletion of every file it held\n            let found = remote.fetch(&origin.branch)?;\n            if !found && status.upstream_commit.is_some() {\n                bail!(\n                    \"the setup branch `{}` is not at {} any more (renamed, or deleted?); nothing was changed. `mise dot origin set {} --branch <name>` follows a renamed branch\",\n                    origin.branch,\n                    origin.url,\n                    origin.url\n                );\n            }\n            // a machine that has never synced has no vanished-branch signal,\n            // so a branch this repository does not have (a declaration that\n            // named the wrong one, or omitted it and took the default) must\n            // not read as an empty upstream either\n            if !found {\n                super::origin::refuse_missing_branch(&remote, &origin.branch, &origin.url)?;\n            }\n            if !found && repo.ref_oid(UPSTREAM_REF)?.is_some() {\n                repo.delete_ref(UPSTREAM_REF)?;\n            }\n            status.last_fetch = Some(hstore::now_rfc3339());\n        }","sourceCodeStart":252,"sourceCodeEnd":288,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/history/sync/run.rs#L252-L288","documentation":"During a non-offline sync, mise fetches the configured origin branch to detect changes. If the branch no longer exists upstream while a previously-recorded upstream commit exists, treating it as empty would queue deletion of every tracked file, so mise aborts without changing anything and suggests re-pointing at the renamed branch.","triggerScenarios":"`mise dot sync` with a connected origin whose configured branch was renamed or deleted on the remote, while status.upstream_commit is set (this machine had synced before).","commonSituations":"Upstream renamed `main` to `master` (or vice versa); the branch was deleted after a repo cleanup; syncing against a fork where the branch never existed; typo introduced when re-setting the origin URL.","solutions":["If the branch was renamed, follow it: `mise dot origin set <url> --branch <new-name>`, then re-run sync.","If the branch was deleted but a replacement exists, set the origin branch to the replacement and sync.","If deletion was unintentional, restore the branch upstream (push it back) and re-run sync.","If offline sync is desired, use the offline mode so the vanished branch is not treated as an empty upstream."],"exampleFix":"// before: branch renamed main -> master\nmise dot sync // error: the setup branch `main` is not at <url> any more\n// after\nmise dot origin set git@example.com:me/dotfiles.git --branch master\nmise dot sync","handlingStrategy":"validation","validationCode":"// confirm the branch exists upstream before syncing\nif !remote_has_branch(origin.url, origin.branch) {\n    eprintln!(\"branch missing upstream; update: mise dot origin set <url> --branch <name>\");\n    return;\n}","typeGuard":null,"tryCatchPattern":"match sync() {\n    Err(e) if e.to_string().contains(\"any more (renamed, or deleted?)\") => eprintln!(\"re-point: mise dot origin set <url> --branch <name>\"),\n    other => other,\n}","preventionTips":["Update the configured branch whenever upstream renames branches (main -> master etc.).","Never delete the setup branch while other machines still sync to it.","Use `git ls-remote <url> <branch>` as a pre-flight check in automation.","Prefer offline mode only when you intentionally want no upstream check."],"tags":["git","sync","branch-missing","remote"],"backgroundTag":"resource-not-found","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}