Skip to content

Instantly share code, notes, and snippets.

@dsmith73
Last active November 22, 2023 06:51
Show Gist options
  • Save dsmith73/cc22031410d6660fd6e999608bb9be91 to your computer and use it in GitHub Desktop.
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
@XzavierBauch
Copy link

XzavierBauch commented Nov 17, 2023

It seems you've handled it effectively. The initial steps of removing the Git directory and initializing a new repository are standard procedures. If any future issues arise, reviewing and modifying the .git/config file, as you described, can be a helpful troubleshooting step. My academic journey took a turn for the better when I discovered this https://domypaper.com/ professional writing service paper writers for hire Hiring the best paper writer from here was a decision that aligned with my pursuit of excellence. The paper delivered was more than just a document – it was a testament to the dedication and expertise of the writer. Trusting this service with my writing tasks has been a transformative experience, and if you're seeking a partner in your academic success, hiring the best paper writer here is the way to go.

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