基本上,我输入:
git config --global use.name "My name"
字符串请注意,我写的是“use.name“而不是“user.name”。但现在该字段在那里,所以我想知道如何删除它。
x9ybnkn61#
你可以使用git config的--unset选项来删除它:
--unset
git config --global --unset use.name
字符串请参阅documentation以了解更多详细信息。
5n0oy7gb2#
字符串或者你可以通过--edit来编辑配置
git config --global --edit
型
jutyujz03#
删除该节,
git config --global --remove-section use
字符串然后
git config --global user.name "Your Name"
ukdjmx9f4#
配置存储在主目录中。尝试编辑~/.gitconfig你会看到类似这样的东西:
~/.gitconfig
[use] name = My name
字符串您可以将其更改为
[user] name = My name
型或者你也可以执行同样的命令,但需要更正。
kqhtkvqz5#
我在我的机器上有多个git帐户,唯一有效的是
git config --local --unset credential.helper git config --global --unset credential.helper git config --system --unset credential.helper git config --local --unset user.name git config --global --unset user.name git config --system --unset user.name git config --local --unset user.email git config --global --unset user.email git config --system --unset user.email
字符串
myss37ts6#
在全局git配置中取消用户名的Git命令:
git config --global --unset user.name "name"
6条答案
按热度按时间x9ybnkn61#
你可以使用git config的
--unset
选项来删除它:字符串
请参阅documentation以了解更多详细信息。
5n0oy7gb2#
字符串
或者你可以通过--edit来编辑配置
型
jutyujz03#
删除该节,
字符串
然后
型
ukdjmx9f4#
配置存储在主目录中。尝试编辑
~/.gitconfig
你会看到类似这样的东西:
字符串
您可以将其更改为
型
或者你也可以执行同样的命令,但需要更正。
kqhtkvqz5#
我在我的机器上有多个git帐户,唯一有效的是
字符串
myss37ts6#
在全局git配置中取消用户名的Git命令:
字符串