I don't know how I've ended up at this stage but on my Mac, using the terminal, if I enter git config --list
, I obtain
credential.helper=osxkeychain
init.defaultbranch=main
user.email=username1@gmail.com
user.name=username1
.
.
.
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
user.name=username2
Why are there two user.name entries and how do I remove username2? The source of this problem was trying to set up two GitHub credentials, one for work (username1) and one for personal (username2).
If I try git config user.name "username1"
, then I get
credential.helper=osxkeychain
init.defaultbranch=main
user.email=username1@gmail.com
user.name=username1
.
.
.
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
user.name=username1
which is better but there's still two entries!