存储库不干净



将角度 7 更新为角度 8,我使用命令 $ ng update @angular/cli@v8 @angular/core@v8 成功更新到 angular/cli angular/core .我也使用了角度材料,所以我想更新材料,然后用$ ng update @angular/material@v8更新。但是运行命令后,我得到了Repository is not clean. Please commit or stash any changes before updating.

所以我在更改 git 之前提交,然后我再次尝试使用相同的命令,然后也收到相同的消息。现在没有要提交或存储的文件。

这是package.json文件的依赖关系: "dependencies": { "@angular/animations": "^8.0.0", "@angular/cdk": "^7.3.7", "@angular/common": "^8.0.0", "@angular/compiler": "^8.0.0", "@angular/core": "^8.0.0", "@angular/forms": "^8.0.0", "@angular/material": "^7.3.7", "@angular/platform-browser": "^8.0.0", "@angular/platform-browser-dynamic": "^8.0.0", "@angular/router": "^8.0.0", "core-js": "^2.5.4", "hammerjs": "^2.0.8", "ngx-loading": "^3.0.1", "rxjs": "6.5.2", "underscore": "^1.9.1", "zone.js": "~0.9.1" }, "devDependencies": { "@angular-devkit/build-angular": "~0.800.0", "@angular/cli": "~8.0.2", "@angular/compiler-cli": "^8.0.0", "@angular/language-service": "^8.0.0", "@types/jasmine": "~2.8.6", "@types/jasminewd2": "~2.0.3", "@types/node": "~8.9.4", "bootstrap-sass": "^3.3.7", "codelyzer": "^5.0.1", "jasmine-core": "~2.99.1", "jasmine-spec-reporter": "~4.2.1", "karma": "~1.7.1", "karma-chrome-launcher": "~2.2.0", "karma-coverage-istanbul-reporter": "~2.0.0", "karma-jasmine": "~1.1.1", "karma-jasmine-html-reporter": "^0.2.2", "karma-scss-preprocessor": "^3.0.0", "protractor": "~5.3.0", "ts-node": "~5.0.1", "tslint": "~5.9.1", "typescript": "~3.4.5" }

这是我收到的消息: D:test>ng update @angular/material@v8 Repository is not clean. Please commit or stash any changes before updating.

我删除了node_modules文件夹,并在$ npm install --save的帮助下重新安装。安装后我再次尝试,然后也收到相同的消息。

有谁知道,如何更新材料?

你提到你有未跟踪的文件。这些会导致检查失败(包含未跟踪文件的 git 存储库被视为不干净(。更多关于这个 这里.

您可以在此处查看ng工具如何运行此检查:https://github.com/angular/angular-cli/blob/3d25d4cb/packages/angular/cli/commands/update-impl.ts#L351

您可以将这些文件存储为:

git stash save --include-untracked

并在运行更新后使用以下命令取消存储它们:

git stash pop
您的

其他选择是删除文件或将它们添加到您的.gitignore

如果要

绕过该警告,则应使用--allow-dirty,它适用于@angular/cli v8.0.1+。

用于更新@angular/material的命令如下所示:

ng update @angular/material@v8 --allow-dirty

要更新所有软件包,您可以使用:

ng update -all --allow-dirty
运行

git reset --hardgit stash,然后重试。

相关内容

  • 没有找到相关文章

最新更新