我在git中运行了一个全局配置命令,使用.gitignore_global文件排除某些文件:

git config --global core.excludesfile ~/.gitignore_global

是否有办法全局撤销此设置的创建?


当前回答

打开配置文件编辑:

git config --global --edit

按Insert并删除设置

最后输入:wq并按“Enter”保存。

其他回答

我不知道你说的“撤销”是什么意思。你可以去掉核心。排除这样的文件设置:

git config --global --unset core.excludesfile

当然,你可以简单地编辑配置文件:

git config --global --edit

...然后用手把设置去掉。

尝试这些命令删除所有用户的用户名和电子邮件。

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

如果某人只想完全删除user对象,那么他应该使用:

git config --global --remove-section user

当用户像user一样不小心添加了更多不需要的属性时,这是非常有用的。密码等。

为了补充larsk应答器,可以在使用vim编辑时使用dd命令删除一个输入行:

git config --global --edit

然后:

按“Esc”键进入正常模式。 将光标放在要删除的行上。 输入dd并按Enter删除该行。

完成后,键入ESQ和:wq

尝试从命令行更改git配置细节。

git config --global --replace-all user.name "Your New Name"

git config --global --replace-all user.email "Your new email"