git - 如何删除git上的多个电子邮件?

标签 git github

我在 git 上不断收到这个错误

warning: user.email has multiple values

然后我检查我的 user.mail

git config --get-all user.mail
juanlazy21@gmail.com
juanlazy21@gmail.com
juanlazy21@gmail.com

我也检查

git config -e

这是文件:

[core]
    repositoryformatversion = 0
    filemode = false
    bare = false
    logallrefupdates = true
    symlinks = false
    ignorecase = true
    hideDotFiles = dotGitOnly
[remote "origin"]
    url = https://github.com/cloudy/coding.git
    fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
    remote = origin
    merge = refs/heads/master
[branch "resolutions"]
    remote = origin
    merge = refs/heads/resolutions

而且我的本地环境中没有任何存储库。我只有一个。

最佳答案

您可以(而不是手动编辑)删除它们:

 git config --global --unset user.mail
 git config --global --unset user.mail

这将删除 user.mail 的前两个条目。

然后检查是否有任何额外的电子邮件:

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

关于git - 如何删除git上的多个电子邮件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38258816/

相关文章:

apache - 使用 git 存储库作为网站根文件夹

java - 在 Openshift 上强制执行构建操作 Hook

git - 错误 : Error fetching remote repo 'origin' returned status code 143

css - 对网站进行更改

git - 查找没有作者的 git 提交

python - git merge 与我们的数据库文件冲突(多个开发人员)

python - 通过 webhook 提交并推送到远程 git 存储库?

git - 如何 stash "pr"远程分支?

git - 没有共同的引用,也没有指定;什么也不做

git - 更改根提交父项以指向另一个提交(连接两个独立的 git 存储库)