Delete username from a Git repository

最后都变了- 提交于 2019-11-30 11:17:19
svick

Use git config -e and you should see something like:

[user]
    name = Shani
    name = shani
    name = shani

Delete the lines you don't want.

Aesch

This worked for me on my Mac:

git config --global --unset-all user.name

If you want to replace the wrong ones with the proper one:

git config --global --replace-all user.name "FName LName"

same applies for user mail:

git config --global --replace-all user.mail "mail-id@domain.com"

Note: with git1.8.1rc1 (December 2012), the logic is different;

"git config --get" used to diagnose presence of multiple definitions of the same variable in the same configuration file as an error, but it now applies the "last one wins" rule used by the internal configuration logic.

Strictly speaking, this may be an API regression but it is expected that nobody will notice it in practice.

If updating email address and password in your config file didn't help then probably you might be using this account with your machine for the first time. Generating and assosiating the pass phrase key with your account helps.

Reference :

https://help.github.com/en/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent https://kbroman.org/github_tutorial/pages/init.html

Cheers !

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!