flutter 报错 error: unable to find git in your path.

项目issue:WIndows: "Unable to find git in your PATH." if terminal is not in admin mode · Issue #123995 · flutter/flutter

解决办法,

方法一:每次想要运行flutter的时候以管理员方式运行,比如以管理方式运行vscode就可以在里面正常运行flutter项目(长远来看不够便捷)

方法二:将flutter项目添加到git的安全项目路径中

管理员模式打开powershell,运行

复制代码
git config --global --add safe.directory '*'

然后打开非管理员模式的powershell运行(主要是为了验证是否成功)

复制代码
flutter doctor

如果不成功,就管理员模式打开cmd,运行

复制代码
git config --global --add safe.directory '*'
相关推荐
cen__y1 天前
Linux12(Git01)
linux·运维·服务器·c语言·开发语言·git
bukeyiwanshui1 天前
20260518 Swift实验
git·swift
qziovv1 天前
Git 回退场景
大数据·git·elasticsearch
来自大山深处的Doge_1 天前
解决Git提交更新更改时出错: detected dubious ownership in repository at ...
git
leazer1 天前
Flutter Windows 构建失败:.plugin_symlinks 符号链接异常的排查与修复
windows·flutter
嵌入式爱好者hsw1 天前
Git 部署本地仓库
git
C137的本贾尼1 天前
Git基本操作(三):版本回退,坐上“时光机”
git
ylifs1 天前
目的驱动式Git用法
git
来尔君1 天前
Git Bash 提示符简化(就是每次敲命令时上面显示的那一行信息)
git·命令行
我叫张小白。1 天前
PyCharm 集成 Git 与 Gitee
git·pycharm·gitee