gpt4 book ai didi

git - 存储库不干净

转载 作者:行者123 更新时间:2023-12-05 00:16:23 28 4
gpt4 key购买 nike

将 angular 7 更新为 angular 8,我成功更新到 angular/cli angular/core使用命令 $ ng update @angular/cli@v8 @angular/core@v8 .
而且我也使用了角 Material ,所以我想更新 Material 然后我更新 $ 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 的帮助下重新安装.安装后我再次尝试,然后也收到相同的消息。

有谁知道,如何更新 Material ?

最佳答案

您提到您有未跟踪的文件。这些导致检查失败(带有未跟踪文件的 git 存储库被认为是不干净的)。更多关于此 here .

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

您可以使用以下方式 stash 这些文件:

git stash save --include-untracked

并在运行更新后取消 stash 它们:
git stash pop

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

关于git - 存储库不干净,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56579750/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com