无法升级Flutter:未配置原始存储库 [英] Unable to upgrade Flutter: no origin repository configured

查看:257
本文介绍了无法升级Flutter:未配置原始存储库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用cmd从此命令更新抖动:

I tried to update flutter from this command using cmd:

flutter upgrade

然后我得到了

Unable to upgrade Flutter: no origin repository configured. Run 'git remote add origin https://github.com/flutter/flutter' in C:\flutter

原因是什么,我该如何解决?

What is the reason and how I can solve this?

推荐答案

尝试flutter doctor,您将看到flutter channel unknown.这就是原因,Flutter使用git来管理框架,并且当您checkout将不同的提交代码/标签flutter channel更改为unknown时.

Try flutter doctor, you will see flutter channel unknown. That is the reason, Flutter uses git to manage the Framework and when you checkout to different commit code / tags flutter channel changed to unknown.

这是您要做的:

flutter channel stable

上面我提到了stable,如果您需要更改要签出的频道(请在终端/cmd中查看flutter channel可用的频道).

Above I mentioned stable, if you need change the channel that you want to checkout (see available channels by flutter channel in terminal / cmd).

然后:

flutter upgrade

现在一切正常.

如果不尝试以下操作:

转到flutter框架所在的目录,并按git branch --set-upstream-to=origin/stable stable设置upstream.

Go to flutter framework located directory and set upstream by git branch --set-upstream-to=origin/stable stable.

请注意,如果在flutter框架所在的目录中尝试,flutter channel stable等同于git checkout stable.

Please note that flutter channel stable is equivalent to git checkout stable if you try in flutter framework located directory.

从已报道的问题跟踪器中了解有关此问题的更多信息.

Learn lot more info about this issue from already reported issue tracker.

这篇关于无法升级Flutter:未配置原始存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆