Repository is not clean. Please commit or stash any changes before updating In Angular 8

前端 未结 7 609
一生所求
一生所求 2021-01-31 00:49

Error

Repository is not clean. Please commit or stash any changes before updating

when i have updated from version 7 to Angular 8.

相关标签:
7条回答
  • 2021-01-31 01:25

    I faced the same issue, I resolved using the below command

    git stash save --include-untracked
    
    0 讨论(0)
  • 2021-01-31 01:28

    First, Check if there are any changes in your code that haven't pushed to git if yes push them, then close the old instance(cmd) and open a new instance of cmd then run the command. This worked for me, Thanks

    0 讨论(0)
  • 2021-01-31 01:28

    I have problem commit and I did the commit all .

    ng update @angular/core @angular/cli
    
    0 讨论(0)
  • 2021-01-31 01:29

    It's a bug in Angular 8

    you can work around it by using:

    ng update @angular/cli @angular/core --allow-dirty

    0 讨论(0)
  • 2021-01-31 01:30

    in my case, this was due to a node_modules folder not being excluded by the .gitignore. once added, this error no longer appeared

    0 讨论(0)
  • 2021-01-31 01:35

    I've had the same issue. It's a common bug in Angular 8. Simply you can use dirty commands to bypass the repo check, such as (if u really need to bypass this, follow force commands)

    ng update @angular/cli @angular/core --allow-dirty or
    ng update @angular/cli @angular/core --allow-dirty --force
    

    but, I didn't do that. I followed following steps...

    first of all double check whether you are commited all the changes before the update.then keep a copy of the project to the same location and commit the copy also to the Git. then run following command from the original project directory

    ng update @angular/core@8 @angular/cli@8
    

    afterwards u can delete the copy. This worked for me! thank you!

    0 讨论(0)
提交回复
热议问题