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 '*'
相关推荐
轮到我狗叫了20 小时前
git - 版本控制工具 - 对应的常见命令 - 以及无需后续每次手动source conda
git
changxiang21 小时前
GIT 备忘
git
ljt27249606611 天前
Flutter笔记--envied
前端·笔记·flutter
DogDaoDao1 天前
Windows 开发提效工具全景指南:60+ 工具的工程化分层配置
windows·git·程序员·开发工具·powershell·everything·msys2
加农炮手Jinx1 天前
Flutter for OpenHarmony 实战:flutter_animate 声明式动画让 UI 灵动如原生
flutter·ui·华为·harmonyos·鸿蒙
里欧跑得慢1 天前
Flutter 像素级还原:设计稿到代码的视觉无损转换技巧
前端·css·flutter·web
里欧跑得慢1 天前
Flutter 三方库 function_tree — 鸿蒙应用开发中的动态数学公式解析与计算神器,实现鸿蒙深度适配下的复杂函数逻辑运行时求值实战(适配鸿蒙 HarmonyOS Next ohos)
android·前端·安全·flutter·华为·harmonyos
wdfk_prog2 天前
GitHub push 失败:如何扫描并清理 Git 历史中的大文件
git·elasticsearch·github
大明二代2 天前
使用 Traefik、cert-manager 和 DNS-01 为内网 Kubernetes 服务配置 HTTPS
git·kubernetes·flux
小芒果_012 天前
git常用命令速查
大数据·git·elasticsearch