{"record":{"id":"442c2b12492da929","repo":"jdx/mise","slug":"source-contains-machine-local-configuration-entr","errorCode":null,"errorMessage":"source contains machine-local configuration ({entry}); remove it from the repository before onboarding","messagePattern":"source contains machine-local configuration \\((.+?)\\); remove it from the repository before onboarding","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/remote_repository.rs","lineNumber":236,"sourceCode":"        .output()?;\n    if !output.status.success() {\n        bail!(\"invalid transferred repository bundle\");\n    }\n    if git(&checkout, &[\"rev-parse\", \"HEAD\"])? != revision {\n        bail!(\"transferred revision mismatch\");\n    }\n    let entries = git(&checkout, &[\"ls-tree\", \"-r\", \"-z\", \"--name-only\", revision])?;\n    for entry in entries.split('\\0').filter(|s| !s.is_empty()) {\n        let path = Path::new(entry);\n        if path\n            .components()\n            .any(|c| !matches!(c, std::path::Component::Normal(_)))\n            || entry.split('/').any(|p| p.eq_ignore_ascii_case(\".git\"))\n        {\n            bail!(\"unsafe source repository path\");\n        }\n        if entry.to_ascii_lowercase().ends_with(\".local.toml\") {\n            bail!(\n                \"source contains machine-local configuration ({entry}); remove it from the repository before onboarding\"\n            );\n        }\n    }\n    git(&checkout, &[\"remote\", \"set-url\", \"origin\", origin])?;\n    let branch = git(&checkout, &[\"symbolic-ref\", \"--short\", \"HEAD\"])?;\n    git(\n        &checkout,\n        &[\"-c\", \"core.hooksPath=/dev/null\", \"checkout\", &branch],\n    )?;\n    if destination.join(\".git\").exists() {\n        if git(destination, &[\"remote\", \"get-url\", \"origin\"])? != origin {\n            bail!(\"global configuration origin does not match\");\n        }\n        if !git(\n            destination,\n            &[\"status\", \"--porcelain\", \"--untracked-files=no\"],\n        )?","sourceCodeStart":218,"sourceCodeEnd":254,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/remote_repository.rs#L218-L254","documentation":"During adoption of a transferred global-configuration repository, mise inspects every file in the bundle's tree and rejects any path ending in `.local.toml`. These files are machine-local configuration (per-machine overrides) and must not be brought into a shared/onboarded repository checkout. The check is case-insensitive on the extension and runs before anything is written to the destination.","triggerScenarios":"Calling install/install_source/preview_source (via install_at) with a bundle whose source repository contains a tracked file matching `*.local.toml` anywhere in the tree; the source path itself is otherwise safe (no traversal, no `.git` components).","commonSituations":"A developer committed their local override file (e.g. `mise.local.toml`, `config.local.toml`) instead of gitignoring it, then tried to onboard the repository onto another machine; CI packaging the config repo included local overrides.","solutions":["Remove the `*.local.toml` file from the source repository: `git rm --cached <file>.local.toml` and commit.","Add `*.local.toml` to the source repo's `.gitignore` so it is never tracked again.","Move machine-local settings into the `.local.toml` on the destination machine instead of the source repo.","Re-package the transfer bundle after the file is removed and retry the install."],"exampleFix":"// before: source repo tracks settings.local.toml\n$ git ls-files | grep local.toml\nsettings.local.toml\n\n// after\n$ echo '*.local.toml' >> .gitignore\n$ git rm --cached settings.local.toml\n$ git commit -m 'stop tracking machine-local config'","handlingStrategy":"validation","validationCode":"const BAD = /\\.local\\.toml$/i;\nconst offending = trackedFiles.filter(f => BAD.test(f));\nif (offending.length) throw new Error(`remove machine-local files first: ${offending.join(', ')}`);","typeGuard":null,"tryCatchPattern":"try {\n  await installSource(bundle, origin);\n} catch (e) {\n  if (/machine-local configuration/.test(String(e.cause ?? e))) {\n    console.error('git rm --cached the *.local.toml files and re-create the bundle');\n  }\n  throw e;\n}","preventionTips":["Add `*.local.toml` to .gitignore in every config repository","Run `git ls-files | grep -i '\\.local\\.toml$'` in CI to fail early on tracked local overrides","Keep machine-specific settings only in the destination-side .local.toml, never in the source repo"],"tags":["git","configuration","machine-local-config","adoption"],"backgroundTag":"invalid-config-value","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"}