{"record":{"id":"f5b0905aad6a43f1","repo":"jdx/mise","slug":"the-setup-branch-is-not-at-any-more-renam","errorCode":null,"errorMessage":"the setup branch `{}` is not at {} any more (renamed, or deleted?); nothing was changed. `mise bootstrap dotfiles origin set {} --branch <name>` follows a renamed branch","messagePattern":"the setup branch `(.+?)` is not at (.+?) any more \\(renamed, or deleted\\?\\); nothing was changed\\. `mise bootstrap dotfiles origin set (.+?) --branch <name>` follows a renamed branch","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/history/sync/run.rs","lineNumber":256,"sourceCode":"        None => origin()?,\n    };\n    let repo = store\n        .repo()\n        .ok_or_else(|| eyre::eyre!(\"synchronizing requires git\"))?;\n    let mode = SyncMode::current()?;\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 bootstrap dotfiles origin set {} --branch <name>` follows a renamed branch\",\n                    origin.branch,\n                    origin.url,\n                    origin.url\n                );\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        }\n        let mut upstream_commit = repo.ref_oid(UPSTREAM_REF)?;\n        outcome.fetched_upstream = upstream_commit.clone();\n        let repo_state = format::detect(repo, upstream_commit.as_deref())?;\n        repo_state.check()?;\n        if repo_state == RepoState::Unmarked && !status.adopted {\n            bail!(\n                \"{} is an existing repository without the mise marker; `mise bootstrap dotfiles origin set {}` previews how it would be adopted\",","sourceCodeStart":238,"sourceCodeEnd":274,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/system/history/sync/run.rs#L238-L274","documentation":"During sync, mise fetches the configured upstream branch. If the fetch reports the branch no longer exists remotely and a previous upstream commit is recorded, treating it as an empty upstream would queue deletion of every file it contained — so mise aborts without changing anything. This protects against branch renames/deletions wiping your dotfiles.","triggerScenarios":"`mise bootstrap dotfiles sync` (non-offline) where `remote.fetch(&origin.branch)` returns `found == false` while `status.upstream_commit` is `Some`; i.e. the branch that was previously synced has disappeared from the remote.","commonSituations":"The remote repository renamed its branch (e.g. `main` -> `master` or a personal rename); the branch was deleted after a repo reorganization; the remote repo was replaced/recreated without that branch.","solutions":["If renamed, follow it: `mise bootstrap dotfiles origin set <url> --branch <new-name>` then sync again","If deleted unintentionally, restore the branch on the remote, then re-run sync","If the repository itself moved, set the new URL: `mise bootstrap dotfiles origin set <new-url>`"],"exampleFix":"// before\n$ mise bootstrap dotfiles sync\nerror: the setup branch `main` is not at git@github.com:me/dotfiles.git any more\n\n// after\n$ mise bootstrap dotfiles origin set git@github.com:me/dotfiles.git --branch master\n$ mise bootstrap dotfiles sync","handlingStrategy":"validation","validationCode":"git ls-remote <url> <branch>   # confirm the branch still exists before syncing","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep the setup branch name stable across machines, or update `origin set --branch` whenever it is renamed","Never delete/rename the setup branch without notifying all synced machines"],"tags":["git","sync","branch-missing","dotfiles"],"backgroundTag":"resource-not-found","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}