Repository is not clean after cli/core update
See original GitHub issueπ Bug report
Command (mark with an x)
- [ ] new
- [ ] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [x] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc
Is this a regression?
No, this issue only applies to updating from version 7 to 8.Description
Iβm unable to update @angular/material when following the update instructions for a basic application. After updating the project with ng update @angular/cli @angular/core, Iβm receiving an error when attempting to run ng update @angular/material.
π¬ Minimal Reproduction
- Create a new application with the CLI v7.3.9
ng new update-test --routing --style scss cdinto the appβs root directory and add angular materialng add @angular/material- Select the Indigo/Pink theme, yes to HammerJS and browser animations
- Begin the update process to v8
ng update @angular/cli @angular/core - Update material
ng update @angular/material
The error should appear after entering the command in step 5 and before the schematic executes.
π₯ Exception or Error
Repository is not clean. Please commit or stash any changes before updating.
π Your Environment
_ _ ____ _ ___
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ β³ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
|___/
Angular CLI: 8.0.0
Node: 12.3.1
OS: darwin x64
Angular: 8.0.0
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.800.0
@angular-devkit/build-angular 0.800.0
@angular-devkit/build-optimizer 0.800.0
@angular-devkit/build-webpack 0.800.0
@angular-devkit/core 8.0.0
@angular-devkit/schematics 8.0.0
@angular/cdk 7.3.7
@angular/material 7.3.7
@ngtools/webpack 8.0.0
@schematics/angular 8.0.0
@schematics/update 0.800.0
rxjs 6.5.2
typescript 3.4.5
webpack 4.30.0
Anything else relevant?
I was able to reproduce on both Windows 10 and OS X.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:6
- Comments:19 (12 by maintainers)
Top Results From Across the Web
Repository is not clean. Please commit or stash any changes ...
It's a bug in Angular 8. you can work around it by using: ng update @angular/cli @angular/core --allow-dirty.
Read more >Resolved: Repository is not clean. Please commit or stash
This error I found to be due to the git repository having uncommitted changes which could be due to a recent upgrade of...
Read more >the installed angular cli version is older than the latest stable ...
Repository is not clean. Update changes will be mixed with pre-existing changes. Using package manager: 'npm' Collecting installed dependencies.
Read more >Upgrade to Angular 14 - Techiediaries
Updating Angular CLI to v14 and upgrading your project to Angular 14 ... In my case, I had an error saying Repository is...
Read more >How to update Angular 7/8 to Angular 9? - Morioh
... core framework using the following command: $ ng update @angular/cli @angular/core --next. In my case, I had an error saying Repository is...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

FYI, there is an
allow-dirtyflag to bypass the repo check.This is expected and intentional. The git repository has uncommitted changes. If the changes arenβt committed before the update then there would be a risk that the update may fail (or succeed but leave the application in a broken state) and there may be no easy way to revert the bad changes introduced by the update.