gpt4 book ai didi

Git - 致命的 : unknown error occured while reading the configuration files

转载 作者:太空狗 更新时间:2023-10-29 13:15:10 26 4
gpt4 key购买 nike

不确定这里是否是发布此问题的正确位置,但是:

当我尝试在我的 Git bash 窗口中执行任何操作时,我收到此错误:

fatal: unknown error occured while reading the configuration files

Git error fatal unknown error occured while reading the configuration files

我在不同的配置下尝试了几次重新安装,并尝试了多次重新启动,但没有任何帮助。我在 Windows 上质疑我的用户名,因为它有一个点 (.)。出于某种原因,这会混淆 Git 吗?如果是这样:是否有解决方法?

我似乎也无法找到我的配置文件所在的位置,因为查找它的命令被破坏并显示相同的错误消息。


我在我的计算机上搜索了 .gitconfig 文件。我一共找到了4个文件:

  • C:\Program Files\Git\mingw64\etc\.gitconfig
  • C:\Program Files\Git\usr\share\vim\vim74\ftplugin\.gitconfig
  • C:\Program Files\Git\usr\share\vim\vim74\indent\.gitconfig
  • C:\Program Files\Git\usr\share\vim\vim74\syntax\.gitconfig

这里是每个文件的内容

...\Git\mingw64\etc.gitconfig

[credential]
helper = manager

...\Git\usr\share\vim\vim74\ftplugin.gitconfig

" Vim filetype plugin
" Language: git config file
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
" Last Change: 2009 Dec 24

" Only do this when not done yet for this buffer
if (exists("b:did_ftplugin"))
finish
endif
let b:did_ftplugin = 1

setlocal formatoptions-=t formatoptions+=croql
setlocal comments=:#,:; commentstring=;\ %s

let b:undo_ftplugin = "setl fo< com< cms<"

...\Git\usr\share\vim\vim74\indent.gitconfig

" Vim indent file
" Language: git config file
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
" Last Change: 2013 May 30

if exists("b:did_indent")
finish
endif
let b:did_indent = 1

setlocal autoindent
setlocal indentexpr=GetGitconfigIndent()
setlocal indentkeys=o,O,*<Return>,0[,],0;,0#,=,!^F

let b:undo_indent = 'setl ai< inde< indk<'

" Only define the function once.
if exists("*GetGitconfigIndent")
finish
endif

function! GetGitconfigIndent()
let line = getline(prevnonblank(v:lnum-1))
let cline = getline(v:lnum)
if line =~ '\\\@<!\%(\\\\\)*\\$'
" odd number of slashes, in a line continuation
return 2 * &sw
elseif cline =~ '^\s*\['
return 0
elseif cline =~ '^\s*\a'
return &sw
elseif cline == '' && line =~ '^\['
return &sw
else
return -1
endif
endfunction

Git\usr\share\vim\vim74\syntax.gitconfig

" Vim syntax file
" Language: git config file
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
" Filenames: gitconfig, .gitconfig, *.git/config
" Last Change: 2010 May 21

if exists("b:current_syntax")
finish
endif

setlocal iskeyword+=-
setlocal iskeyword-=_
syn case ignore
syn sync minlines=10

syn match gitconfigComment "[#;].*"
syn match gitconfigSection "\%(^\s*\)\@<=\[[a-z0-9.-]\+\]"
syn match gitconfigSection '\%(^\s*\)\@<=\[[a-z0-9.-]\+ \+\"\%([^\\"]\|\\.\)*"\]'
syn match gitconfigVariable "\%(^\s*\)\@<=\a\k*\%(\s*\%([=#;]\|$\)\)\@=" nextgroup=gitconfigAssignment skipwhite
syn region gitconfigAssignment matchgroup=gitconfigNone start=+=\s*+ skip=+\\+ end=+\s*$+ contained contains=gitconfigBoolean,gitconfigNumber,gitConfigString,gitConfigEscape,gitConfigError,gitconfigComment keepend
syn keyword gitconfigBoolean true false yes no contained
syn match gitconfigNumber "\d\+" contained
syn region gitconfigString matchgroup=gitconfigDelim start=+"+ skip=+\\+ end=+"+ matchgroup=gitconfigError end=+[^\\"]\%#\@!$+ contained contains=gitconfigEscape,gitconfigEscapeError
syn match gitconfigError +\\.+ contained
syn match gitconfigEscape +\\[\\"ntb]+ contained
syn match gitconfigEscape +\\$+ contained

hi def link gitconfigComment Comment
hi def link gitconfigSection Keyword
hi def link gitconfigVariable Identifier
hi def link gitconfigBoolean Boolean
hi def link gitconfigNumber Number
hi def link gitconfigString String
hi def link gitconfigDelim Delimiter
hi def link gitconfigEscape Delimiter
hi def link gitconfigError Error

let b:current_syntax = "gitconfig"

我运行的是 Windows 7 x64 专业版。计算机是域网络的一部分。

我用 Google 搜索了这个问题,当我来到第 11 页时没有找到任何有用的东西,我放弃了。

最佳答案

对我来说,问题是用户中的 .gitconfig 文件夹/目录//删除目录 (.gitconfig) 解决了这个问题,现在工作正常。 click on this link to refer the image for solution

关于Git - 致命的 : unknown error occured while reading the configuration files,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38070483/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com