Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ng update --all does say 'Repository is not clean' evendought git commit

I'm trying to update my Angular with ng update --all as in this question stated [https://stackoverflow.com/questions/56419456/cant-find-compiler-ngcc-module-after-upgrading-angular-and-project], but it always says Repository is not clean. Please commit or stash any changes before updating.

I have run the following commands today:

npm install
npm install -g @angular/cli
npm install --save font-awesome angular-font-awesome
npm install angular-alert-module --save

At this state the program compiled

ng update @angular/cli

since then it does not compile

I read I need to do ng update --all --force but it doesn't work because the repository 'is not clean'.

I made a commit pushed it and pulled (where there were no changes) before. But it didn't help

ng update --all --force

The error-message is:

Repository is not clean.  Please commit or stash any changes before updating.
like image 695
T-Dog18 Avatar asked Jun 10 '19 17:06

T-Dog18


2 Answers

You should use --allow-dirty if you want to bypass that warning.

This works on @angular/cli v8.0.1+.

ng update --all --allow-dirty
like image 155
J J B Avatar answered Oct 21 '22 09:10

J J B


The issue was, that I commited all files (including the package-lock.json) it did mark it as modified. (I don't know why). Therefore the tree was not possible.

Because commiting was not possible (even though the error message suggests it), I had to stash it. Then it worked, but I had to stash after every command.

like image 22
T-Dog18 Avatar answered Oct 21 '22 08:10

T-Dog18