Skip to content

Instantly share code, notes, and snippets.

@dsmith73
Last active October 21, 2024 16:56
Show Gist options
  • Select an option

  • Save dsmith73/cc22031410d6660fd6e999608bb9be91 to your computer and use it in GitHub Desktop.

Select an option

Save dsmith73/cc22031410d6660fd6e999608bb9be91 to your computer and use it in GitHub Desktop.
fatal: bad config line 1 in file .git/config

fatal: bad config line 1 in file .git/config

When I receive this error, the fix is to:

rm -rf .git

Then, I can git init again, with a clean initialization, and it works...


If the solution above doesn't work

Another solution that I found for this is:

  • open .git/config file
  • clear all the NULL values in the file
  • save and close the file
  • git add .

#dsmith73
github.com/dsmith73
@mhotep
Copy link

mhotep commented Sep 21, 2024

It works. Thank you. Nulls were there, but not there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment