Angular CLI: Repository is not clean. Please commit or stash any changes before updating.
ng update refuses to run because git has uncommitted changes; it wants every migration to be a reviewable diff.
Repository is not clean. Please commit or stash any changes before updatingRepository is not cleanng update repository not clean Meaning
Angular's update schematics edit many files. To keep the changes reviewable and reversible, the CLI requires a clean working tree. Commit or stash first, or pass --allow-dirty if you really want to proceed.
Common causes
- Uncommitted or untracked files in the repository
- Modified
package-lock.jsonor build output not ignored - Generated files missing from
.gitignore - Running the command in a monorepo root with unrelated changes
⚡ Quick fix
- Commit or stash:
git add -A && git commit -m "before ng update" - Ignore build output in
.gitignore - Use
--allow-dirtyonly when you accept the risk
Detailed fix by platform
Linux
git statusto see what is dirty;git stash -uto set changes aside, thenng updateandgit stash pop
Angular CLI
ng update @angular/core @angular/cli --allow-dirty(not recommended)
How to diagnose
- Status — What does git status list?
- Ignore — Are generated files ignored?
- Risk — Can you commit first?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- Could not find the builder's node package Angular CLI: Could not find the '@angular-devkit/build-angular:browser' builder's node package / Cannot find module '@angular-devkit/build-angular/package.json'
- ERESOLVE peer dependency conflict after ng update Angular: npm ERR! ERESOLVE could not resolve — Conflicting peer dependency: @angular/core@"^16.0.0" (after ng update / ng add)
- exceeded maximum budget Angular build: Error: bundle initial exceeded maximum budget. Budget 1.00 MB was not met by 120.00 kB with a total of 1.12 MB
Most viewed in Angular
Other ways to find it
Where this error sits
Origin: On your device. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 15 Oct 2026