Repository is not clean Angular Origin: On your device Last updated 15 Oct 2026

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.

Exact message you may see Repository is not clean. Please commit or stash any changes before updatingRepository is not cleanng update repository not clean
Seen on: Angular Angular CLI Git

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.json or build output not ignored
  • Generated files missing from .gitignore
  • Running the command in a monorepo root with unrelated changes

⚡ Quick fix

  1. Commit or stash: git add -A && git commit -m "before ng update"
  2. Ignore build output in .gitignore
  3. Use --allow-dirty only when you accept the risk

Detailed fix by platform

Linux

  1. git status to see what is dirty; git stash -u to set changes aside, then ng update and git stash pop

Angular CLI

  1. ng update @angular/core @angular/cli --allow-dirty (not recommended)

How to diagnose

  1. Status — What does git status list?
  2. Ignore — Are generated files ignored?
  3. 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:

Where this error sits

Origin: On your device. Errors that are often confused with or caused by this one (click to open):

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' (Angular)Could not find the bu…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) (Angular)ERESOLVE peer depende…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 (Angular)exceeded maximum budg…ng: command not found — Angular CLI: zsh: command not found: ng / 'ng' is not recognized as an internal or external command (Angular)ng: command not foundNode.js version detected. The Angular CLI requires a minimum — Angular CLI: Node.js version v16.20.2 detected. The Angular CLI requires a minimum Node.js version of v18.19.1 (Angular)Node.js version detec…Port 4200 is already in use — Angular CLI: Port 4200 is already in use. Use '--port' to specify a different port (Angular)Port 4200 is already …Schema validation failed with the following errors — Angular CLI: Schema validation failed with the following errors: Data path "" must NOT have additional properties(xyz) (Angular)Schema validation fai…Repositor…

Explore the map of this error Full error map →

🧠 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.