Need help with gitconfig, please


I haven’t been able to get git config —get to return my full name. Typing git config —get returns my first name only, preceded by a double quote, like this “Mark

How can I get git config — get.user name to return my full name and not just a quote and my first name?

I’ve copied and pasted as well as typed ‘git config --global “Mark LastName” ‘ into the terminal and always get the same result .

Thanks in advance for any help!


Hi M_June.

try to re-configure the using command:

git config --global “User Name”

then you can retrieve it by:
git config --global
git config --get

both options should work fine.


Hi Ghassan,

Thanks for your reply.

I’ve already done what you suggest and I always get the same result. At the time I first posted my question, I had accidentally forgotten to install homebrew, git, Heroku and Ruby. I’ve now installed all those programs.

By entering `git config --list’, I currently get the following values:


It looks likegit config --global “User Name”` just adds additional, incomplete values for and doesn’t overwrite the old values.

How can I delete the multiple instances of“Mark and replace them with just one value for global How can I get git config to accept both my first and last names?

Thanks again



I was able to edit the .gitconfig file in visual studio code, maybe you can take a look at it and edit it using a text editor. looks like you are using a mac - i don’t know how.

The file is supposedly located in $HOME/.gitconfig in all platforms.


Ok,thanks. I will try


Hello all,

I tried editing .gitconfig with a text editor and it has created additional problems. Here’s what happened:

In my text editor, I deleted all but one instance of“Mark
In my text editor, I changed“Mark to“Mark Lastname”
In Terminal, I entered ‘git config --get’
It returned the following error fatal: bad config line 3 in file /Users/mnh/.gitconfig
In Terminal, I entered git config --global “Mark Lastname”
Again, it returned fatal: bad config line 3 in file /Users/mnh/.gitconfig.

Does anyone have any idea about how to solve this?



can you copy and paste the contents of you file. we can try to determine the cause of the error.



	email = “”
	name = “Mark Lastname"
	ui = auto

I don’t know why some of the text show up red. In my text editor, it was black.


are the quotation marks in your file?




ok lets remove the quotation marks.
also remove the empty line before [color]
your file should look like this:

email =
name = Mark Lastname
ui = auto


Thanks so much, Ghassan! I removed the quotes and empty line and it works. Thanks for taking the time and have a good weekend