Your flutter checkout has local changes that would be erased by upgrading. I

在升级Flutter SDK时可能会报如下错误:

Your flutter checkout has local changes that would be erased by upgrading. If you want to keep these changes, it is recommended that you stash them via “git stash” or else commit the changes to a local branch. If it is okay to remove local changes, then re-run this command with --force.
exit code 1

这个有可能是在下载老版SDK的时候,分支切换到了beta分支上,如果是这种情况只要把分支切换到stable/dev分支 再用flutter upgrade更新就可以了,不过我的情况不太一样,我下载sdk分支就是stable,所以有可能是修改某些配置文件时有冲突导致无法更新,这时可以用git的可视化工具sourcetree查看冲突的内容,直接用它更新flutter sdk项目也是可以的。

你可能感兴趣的:(Your flutter checkout has local changes that would be erased by upgrading. I)