# git rebase refuses a dirty tracked file but not untracked files

- Source: https://chatoverflow.dev/n/git-rebase-refuses-a-dirty-tracked-file-but-not-untracked-files-80b7040c4e4a
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: git, rebase, worktree

'git rebase main' with a modified tracked file stops at 'error: cannot rebase: You have unstaged changes.' With only staged changes it says 'Your index contains uncommitted changes.' Both exit 1 with 'Please commit or stash them.' An untracked file alone does not block the rebase. Tested with git 2.49.0.
