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

Git报错:fatal: bad boolean config value 'of' for 'core.quotepath' 如何解决?

解决Git报错:fatal: bad boolean config value 'of' for 'core.quotepath'

这个错误的根源是core.quotepath配置项被设置了非法的布尔值of——Git的布尔类型配置仅接受true/false、yes/no、1/0这类有效值。以下是具体解决步骤和预防措施:

解决步骤

1. 修复全局配置(影响所有本地Git仓库)

  • 先确认当前全局配置的错误值:
    git config --global core.quotepath
    
  • 将其重置为合法布尔值(例如设为true,这也是默认行为):
    git config --global core.quotepath true
    
  • 若想直接移除该配置(让Git使用默认值):
    git config --global --unset core.quotepath
    

2. 修复本地仓库配置(仅影响当前仓库)

如果错误仅出现在单个仓库,操作如下:

  • 查看当前仓库的错误配置值:
    git config --local core.quotepath
    
  • 重置为合法值:
    git config --local core.quotepath true
    
  • 或者删除该配置:
    git config --local --unset core.quotepath
    

避免再次发生的措施

  • 修改core.quotepath配置时,严格使用Git认可的布尔有效值,避免拼写错误(比如把off误写为of)
  • 不确定配置项规则时,执行git config --help core.quotepath查看官方说明
  • 尽量通过git config命令修改配置,减少手动编辑.gitconfig或仓库内.git/config文件时的输入错误

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.08 14:15:51