-1

I have searched the bowels of the internet and have been unable to determine what could be going on here:

  • For some reason, the line safecrlf = trueexport keeps appending to my [core] global .gitconfig settings
  • It will often be appended multiple times
  • This causes the following error when I try to run any git command: fatal: bad boolean config value 'trueexport' for 'core.safecrlf'

The rest of my .gitconfig is quite simple:

[user]
    name = myusername
    email = myemail@email.com
[core]
    editor = code --wait
    autocrlf = input
    safecrlf = true
    safecrlf = trueexport // here's the offending line
    safecrlf = trueexport // as you can see, in this instance it appended 4 times
    safecrlf = trueexport 
    safecrlf = trueexport

[color]
    ui = auto

[alias]
  co = checkout
  ci = commit
  st = status
  br = branch
  hist = log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short
  type = cat-file -t
  dump = cat-file -p

[init]
    defaultBranch = main
  • I can resolve this error by deleting this setting, but it keeps reappearing
  • I have not been able to identify any pattern that leads to the line getting appended
  • It happens quite regularly, but once I delete the offending line I can generally use git with no issues for a bit, but again, there is no consistent pattern that I have been able to recognize (it's not, for example, something like "The line appears once a day and after deleting it I can use git for another 24 hours")
  • I have tried adding and removing the following settings as well, but it doesn't seem to impact this behavior:
    autocrlf = input
    safecrlf = true

1 Answers1

0

You have a misbehaving program (or IDE plugin for Visual Studio Code or whatever) that runs git config --global --add core.safecrlf trueexport. Find it and squash its bug. (The problem is not in Git itself; this would have been found ages ago, if it were.)

I suspect the misbehaving program is supposed to read:

git config --global --add core.safecrlf true
export something

and somehow the export word from the subsequent line got pasted up against the true word from the git config line.

torek
  • 448,244
  • 59
  • 642
  • 775