Subject: Re: bugreport: "git config --global" fails if an invalid .git file present

From: Junio C Hamano <[email-masked]>
Date: Thu, 18 Aug 2022 09:28:14 -0700

Jeff King <[email-masked]> writes:

> And that would make your case Just Work. But it's also more dangerous;
> if a misconfiguration or transient error caused us to set up an
> unexpected environment, then the results could be quite wrong and
> confusing. Maybe less so for "git config", but for destructive
> operations it's a scarier concept.

That is a good point, especially if destructive command is run in a
repository the user didn't mean to run it in, it would not be
pretty.

> In your case, the right resolution is probably to delete the bogus .git
> file.

Yup, that was what I said in a draft I wrote a few days ago and
still in my outbox ;-)