【问题标题】:Multiple GIT accounts configured on same machine, one with Gerrit and another with GitHub在同一台机器上配置多个 GIT 帐户,一个使用 Gerrit,另一个使用 GitHub
【发布时间】:2021-02-03 09:41:31
【问题描述】:

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

我关注了以下帖子的答案中提到的 Tutsplus You 管视频:

Multiple github accounts on the same computer?

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

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 帐户?

【问题讨论】:

    标签: git github git-bash gerrit


    【解决方案1】:

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

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

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

    【讨论】:

      猜你喜欢
      • 2011-04-21
      • 2013-09-21
      • 1970-01-01
      • 1970-01-01
      • 2015-07-02
      • 2021-03-28
      • 1970-01-01
      • 2021-12-20
      相关资源
      最近更新 更多