Where to find the .gitconfig file?

Hi, in this post Im going to show you where to find the .gitconfig in Mac.

Recently I had this issue on Github when I try to push changes to main branch:

error: key does not contain a section: name
error: key does not contain a section: email

So, I was trying to modify the .gitconfig file from the terminal, but as we know sometimes use the terminal requiere more knowledge (like use VI text editor) well I decided to edit this file directly from the file, so here where I found the file, then I drag & drop the file to the Visual studio:

Then I inserted the [core] code and I save it the file directly and now all good:

By Cristina Rojas.