You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

误执行git fetch导致flutter upgrade报错,寻求解决方法

解决Flutter Upgrade因Git远程地址错误导致的失败问题

步骤1:检查当前Git远程仓库地址

进入你的Flutter安装目录(比如~/flutter或C:\flutter),执行命令查看当前远程地址:

git remote -v

你会看到origin指向了错误的私有仓库地址,类似:

origin  https://github.com/my_user_name/flutter.git/ (fetch)
origin  https://github.com/my_user_name/flutter.git/ (push)

步骤2:修改远程仓库地址为官方地址

执行命令将远程地址替换为Flutter官方仓库:

git remote set-url origin https://github.com/flutter/flutter.git

步骤3:重新执行Flutter Upgrade

现在直接运行升级命令即可正常执行:

flutter upgrade

如果仍有异常,可先手动执行一次fetch验证:

git fetch --tags

内容的提问来源于stack exchange,提问作者sub

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.13 03:32:02