【发布时间】:2015-12-17 00:50:41
【问题描述】:
在尝试提交存储库时,我收到错误:
$ git commit
*** Please tell me who you are.
Run
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
to set your account's default identity.
Omit --global to set the identity only in this repository.
fatal: unable to auto-detect email address (got '[output redacted]')
显而易见的解决方案是在输出中运行 git config 选项,但我不想这样做。
相关计算机不属于特定人员,而是共享计算机。因此,每次提交都会是不同的用户。
如何绕过这一点并将作者设置为每次提交而不是全局?
【问题讨论】:
-
如果您运行
git config而不使用--global选项,您将仅为该特定克隆设置作者。 -
@approxiblue 如果多个人要添加到同一个克隆怎么办?
-
为多个提交者提供一个克隆无论如何都是有问题的做法。你为什么要这么做?
-
代码是作为一个团队工作的。有问题的计算机也属于团队,没有人明确表示,这意味着团队中的任何人都可以使用它。
标签: git git-commit git-config