在同一台机器上配置了多个 GIT 个帐户,一个使用 Gerrit,另一个使用 GitHub

Multiple GIT accounts configured on same machine, one with Gerrit and another with GitHub

我在同一台机器上配置了 2 个 GIT 帐户,一个使用 Gerrit(工作帐户),另一个使用 GitHub(个人)。

我关注了下面答案中提到的 Tutsplus You 视频 post:

Multiple github accounts on the same computer?

我的工作帐户已经配置好并且工作正常并遵循全局 git 配置,而对于个人工作,我创建了一个本地配置文件并按照以下 [=37] 更新了用户名和电子邮件地址=]:

Git pushing to remote GitHub repository as wrong user

现在,当我尝试使用 Git Bash 从个人目录提交任何内容时,出现以下错误:

ERROR: Commit message is missing Identification: Please append the Identification: and issue ID relative to this commit into the commit message.

我知道当我向我的 Gerrit 帐户提交或推送任何内容时需要身份验证。所以这意味着这是使用或遵循基于 Gerrit 的帐户配置而不是我的个人工作帐户配置(GitHub)

现在如何使用与 Git Hub 关联的个人工作帐户而不打扰基于 Gerrit 的 GIT 帐户?

您似乎设置了一个 post-commit 挂钩来拒绝没有问题 ID 的提交,即使在您的个人工作帐户存储库中也是如此。

.git/hooks 目录中查找 post-commit(或 pre-push)文件,如果存在则将其删除。

它可能已被 init.templatedir 全局配置放置在那里 -- 尝试 运行 git config --list 进行检查。