jdx/mise · error
global configuration has uncommitted changes
Error message
global configuration has uncommitted changes
What it means
Before updating or adopting an existing global-configuration checkout, mise requires a clean working tree. `git status --porcelain --untracked-files=no` is run in the destination; any output means tracked files have uncommitted modifications, and mise aborts rather than merging or overwriting user changes.
Solutions
- Review and commit the pending changes: `git -C <destination> add -A && git -C <destination> commit -m 'local changes'`.
- If the edits are unwanted, discard them: `git -C <destination> restore .` (and `git restore --staged .` for staged entries).
- Stash them if you want to keep them temporarily: `git -C <destination> stash`.
- Re-run the install once `git status --porcelain --untracked-files=no` prints nothing.
Example fix
// before $ git -C ~/.config/mise status --porcelain --untracked-files=no M settings.toml // after $ git -C ~/.config/mise add settings.toml && git -C ~/.config/mise commit -m 'update settings' $ git -C ~/.config/mise status --porcelain --untracked-files=no # (empty)
Defensive patterns
Strategy: validation
Validate before calling
const out = execSync(`git -C ${dest} status --porcelain --untracked-files=no`).toString();
if (out.trim()) throw new Error('commit or discard changes in ' + dest + ' before installing'); Try / catch
try {
await installSource(bundle, origin, { update: true });
} catch (e) {
if (/uncommitted changes/.test(String(e.cause ?? e))) {
execSync(`git -C ${dest} stash`); // or commit
return installSource(bundle, origin, { update: true });
}
throw e;
} Prevention
- Commit or stash edits to global config immediately instead of leaving them dirty
- Check `git status --porcelain --untracked-files=no` is empty before running updates
- Disable editors/tools that rewrite config files (formatters, line-ending conversion) in the checkout
When it happens
Trigger: install/install_source/preview_source (install_at) against a destination with a `.git` directory where any tracked file is modified or staged (untracked files are ignored by the check).
Common situations: Hand-edited config files that were never committed; a partially finished `git add`/merge left staged changes; an editor or tool rewrote files (line endings, formatting) since the last commit.
Understand the failure class
Background: "git command failed": what it means when a tool shells out to git and git exits non-zero — this error's family across 21 libraries.
Related errors
- existing file conflicts with adoption
- global configuration branch differs from the transferred…
- global configuration origin does not match
- no setup repository is connected; `mise bootstrap dotfiles…
- no setup repository is connected; `mise dot origin set
AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17).
Data as JSON: /api/errors/787ad62f1a097252.
Report an issue: GitHub.
Appendix: source
Thrown at src/system/remote_repository.rs:257
}
}
git(&checkout, &["remote", "set-url", "origin", origin])?;
let branch = git(&checkout, &["symbolic-ref", "--short", "HEAD"])?;
git(
&checkout,
&["-c", "core.hooksPath=/dev/null", "checkout", &branch],
)?;
if destination.join(".git").exists() {
if git(destination, &["remote", "get-url", "origin"])? != origin {
bail!("global configuration origin does not match");
}
if !git(
destination,
&["status", "--porcelain", "--untracked-files=no"],
)?
.is_empty()
{
bail!("global configuration has uncommitted changes");
}
if update {
if git(destination, &["symbolic-ref", "--short", "HEAD"])? != branch {
bail!("global configuration branch differs from the transferred branch");
}
if dry_run {
// the bundle holds the history from the checkout's commit on,
// so the fast-forward is checked there without fetching into
// the destination
let head = git(destination, &["rev-parse", "HEAD"])?;
if head == revision {
miseprintln!(
"Would keep {shown} at {revision}, already the transferred revision"
);
} else if git(&checkout, &["merge-base", "--is-ancestor", &head, revision]).is_ok()
{
miseprintln!("Would fast-forward {shown} from {head} to {revision}");
} else {View on GitHub (pinned to 533346cc37)