0

I am using vs code for working on my github repository. I tried checking in my code in Visual Studio Code and saw this message.
"Make sure you configure user.name and user.email in git"

I tried to add user.name and user.email but to my surprise, i saw alreayd having those entries and now I am having multiple entries of user.name. I tried to delete it using --replace-all but ending up more entries. I am doing this under vscode terminal. Below is the snapshot:
user.name=--list
user.name==
user.name=--replace-all
user.name=--replace-all

I tried to set the git config through Powershell under the installed directory location:

PS C:\Program Files\Git\bin> git config --global user.email "<my email id>"``
PS C:\Program Files\Git\bin> git config --list  
....
....
user.name=Adil Mujeeb
user.email="<my email id>"

This time when i do commit from vscode, it got successful but to my surprise, it picked wrong entry.

Author: --replace-all "<my email id>"

How to fix this?

Gama11
  • 31,714
  • 9
  • 78
  • 100
Adil
  • 2,418
  • 7
  • 34
  • 38

1 Answers1

0

This answer solved my problem.

First we need to find out in which of the 3 config files you have more than one user.name line:

git config --local  --get-all user.name #local repo git config file)
git config --global --get-all user.name #user config file)
git config --system --get-all user.name #system git config file)

The one config file which answers more than one user.name value needs to be fixed:

git config --local --replace-all user.name "User name"
Adil
  • 2,418
  • 7
  • 34
  • 38