Git 颤振能';t将频道切换到beta
我正在尝试切换颤振通道以使用颤振web。但每次我都会犯这个错误。无论是切换到颤振主控还是颤振测试Git 颤振能';t将频道切换到beta,git,flutter,flutter-web,flutter-channel,Git,Flutter,Flutter Web,Flutter Channel,我正在尝试切换颤振通道以使用颤振web。但每次我都会犯这个错误。无论是切换到颤振主控还是颤振测试 P:\FlutterProjects>flutter channel master Switching to flutter channel 'master'... git: From https://github.com/flutter/flutter git: 1ad9baa8b..8af6b2f03 stable -> origin/stable git:
P:\FlutterProjects>flutter channel master
Switching to flutter channel 'master'...
git: From https://github.com/flutter/flutter
git: 1ad9baa8b..8af6b2f03 stable -> origin/stable
git: error: cannot lock ref 'refs/remotes/origin/beta': unable to resolve reference 'refs/remotes/origin/beta': reference broken
git: ! [new branch] beta -> origin/beta (unable to update local ref)
git: 1ad9baa8b..8af6b2f03 flutter-1.17-candidate.3 -> origin/flutter-1.17-candidate.3
git: df98ad6b2..0bffc8a39 master -> origin/master
git: * [new tag] 1.17.5 -> 1.17.5
git: error: cannot lock ref 'refs/tags/1.20.0-0.0.pre': unable to resolve reference 'refs/tags/1.20.0-0.0.pre': reference broken
git: ! [new tag] 1.20.0-0.0.pre -> 1.20.0-0.0.pre (unable to update local ref)
Switching channels failed with error code 1
在命令行中,导航到安装颤振的目录并运行以下命令
$ rm .git/refs/remotes/origin/beta
$ git fetch
如果上述方法不起作用,请尝试以下方法
$ git gc --prune=now
$ git remote prune origin
上面的命令将删除断开的参考,下面的命令将确保在更改通道之前在当前通道上完全升级颤振
$ flutter upgrade
$ flutter channel master
$ flutter upgrade
谢谢你的精彩回答,但我很抱歉地告诉你,它不起作用,我试图自己从目录中删除beta版,但git fetch仍然显示相同的错误/Hey@Prateek,我只是用更多可以尝试的命令更新了答案