{"record":{"id":"e5cce79e35e09cd7","repo":"gitbutlerapp/gitbutler","slug":"this-will-be-replaced-with-gitbutler-s-but-comma","errorCode":null,"errorMessage":"This will be replaced with GitButler's 'but' command","messagePattern":"This will be replaced with GitButler's 'but' command","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"crates/but-installer/src/install_macos.rs","lineNumber":156,"sourceCode":"        ));\n    } else if but_symlink.is_symlink() {\n        let existing_target = fs::read_link(&but_symlink)?;\n        let existing_target_str = existing_target.to_string_lossy();\n\n        // Detect channel switching\n        let previous_channel = if existing_target_str.contains(\"Nightly\") {\n            Some(Channel::Nightly)\n        } else if existing_target_str.contains(\"/GitButler.app/\") {\n            Some(Channel::Release)\n        } else {\n            None\n        };\n\n        if previous_channel.is_none() {\n            warn(&format!(\n                \"Found existing 'but' symlink pointing to: {existing_target_str}\"\n            ));\n            warn(\"This will be replaced with GitButler's 'but' command\");\n            info(\n                \"Note: Your custom symlink setup will be overwritten. The original target is not a GitButler installation.\",\n            );\n        }\n    }\n\n    // Create temporary symlink to test the new installation\n    let new_app_macos_dir = install_app_new.join(\"Contents/MacOS/gitbutler-tauri\");\n    let _ = fs::remove_file(&but_new);\n\n    unix_fs::symlink(&new_app_macos_dir, &but_new)?;\n\n    // Verify the new installation works\n    let verify_status = Command::new(&but_new)\n        .arg(\"--version\")\n        .stdout(Stdio::null())\n        .stderr(Stdio::null())\n        .status();","sourceCodeStart":138,"sourceCodeEnd":174,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/caf1f223d3cfb94488c9198ad34487c6006c648f/crates/but-installer/src/install_macos.rs#L138-L174","documentation":"Companion warning in the same block as the 'Found existing but symlink' message (install_macos.rs:156): the installer explicitly states that the custom, non-GitButler symlink will be replaced by GitButler's 'but' command during the atomic swap. Together with the following info line it tells you the original target is not a GitButler installation and will not be preserved (unlike the regular-file case, which gets a but.backup.<timestamp> copy). There is no prompt and no rollback for this specific action; the target path is only recorded in the log output.","triggerScenarios":"Same condition as the preceding warn: ~/.local/bin/but is a symlink whose target contains neither 'Nightly' nor '/GitButler.app/', e.g. a hand-made link to ~/.cargo/bin/but or a third-party binary. The swap at install_macos.rs:227-230 then removes the old link (fs::remove_file) and symlinks to the new app bundle.","commonSituations":"Users who manage their own bin symlinks; migrating from manual CLI installs to the desktop app; discovering post-install that a custom wrapper script target is gone because only the symlink text was logged, not saved.","solutions":["Before installing, record the current target if you care about it: readlink ~/.local/bin/but > ~/but-symlink.bak","If the target was a wrapper or custom build, re-create it under a distinct name after install (ln -sfn /path/to/custom ~/.local/bin/but-custom)","Remove the custom symlink pre-install (rm ~/.local/bin/but) to get a clean, warning-free install","Verify the replacement: but --version should report the GitButler app-bundled CLI"],"exampleFix":"# before\nrm ~/.local/bin/but              # avoid the overwrite warning entirely\n\n# after install\nreadlink ~/.local/bin/but\n/Users/me/Applications/GitButler.app/Contents/MacOS/gitbutler-tauri","handlingStrategy":"validation","validationCode":"# Pre-install check for a custom (non-GitButler) symlink target:\nif [ -L ~/.local/bin/but ]; then\n  t=$(readlink ~/.local/bin/but)\n  case \"$t\" in *GitButler.app*|*Nightly*) ;; *) rm ~/.local/bin/but;; esac\nfi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Remove or rename custom symlinks before installing to get a clean swap with no overwrite","Wrap scripts or custom targets you want to keep: re-create them under ~/.local/bin/but-custom after install","Treat the warning text as your only record of the old target - copy it out of the installer log if it matters"],"tags":["macos","installer","symlink","overwrite","cli"],"backgroundTag":"symlink-conflict","analyzedSha":"caf1f223d3cfb94488c9198ad34487c6006c648f","analyzedAt":"2026-08-20T07:55:40.983Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}