git
› Pro Git
› Atlassian Git Tutorial
› Pro Git 简体中文翻译
› GitX
DeathWing
V2EX  ›  git

git 自动提交脚本 push 后显示的是别人的帐号(确定邮箱不是那个人的)

  •  
  •   DeathWing · Oct 1, 2020 · 5130 views
    This topic created in 2224 days ago, the information mentioned may be changed or developed.

    一开始无聊写了个脚本,本地测试了一下,可以自动提交代码。随后丢到服务器上。今天一看 git log,日志显示:Author: ubuntu [email protected] ,随后检查 git config --list,user.name 和 user.email 都是我自己的没错,那到此我觉得可能脚本哪里不完善。

    重点来了!!!

    我登录 github 看的时候,这个提交的头像竟然是路飞??还是个国人,一看这个人的资料写的是 [email protected] 。我在想,难道这个人的 github 注册邮箱是 [email protected] ?不可思议。。。

    20 replies  •  2020-10-10 09:18:30 +08:00
    DeathWing
    DeathWing
    OP
    Oct 1, 2020
    1
    [Imgur]( )
    ericwood067
    ericwood067
    Oct 1, 2020
    2
    []( https://docs.github.com/en/free-pro-team@latest/github/committing-changes-to-your-project/why-are-my-commits-linked-to-the-wrong-user)

    Commits are linked to another user
    If your commits are linked to another user, that means the user has added the email address in your local Git configuration settings to their GitHub account. In this case, you can change the email in your local Git configuration settings and add the new email address to your GitHub account to link future commits to your account.
    DeathWing
    DeathWing
    OP
    Oct 1, 2020
    3
    @ericwood067 那他把 [email protected] 加到了他账户里?这。。好像说不通
    ericwood067
    ericwood067
    Oct 1, 2020❤️1
    4
    @DeathWing 应该是这样的,github 的 settings 里有一个 Emails,里面有一个 Add email address 的选项。
    Kr98
    Kr98
    Oct 1, 2020 via Android
    5
    @ericwood067 关键是他怎么通过邮箱验证的
    uTOmOuk3L6sb4MSI
    uTOmOuk3L6sb4MSI
    Oct 1, 2020 via iPhone
    6
    我用 mac 和 ios 提交,头像不一样。
    一个是旧的头像,一个是新的头像。

    用的 vscode 和 working copy
    sola97
    sola97
    Oct 1, 2020
    7
    我也遇到过
    DeathWing
    DeathWing
    OP
    Oct 1, 2020
    8
    @ODD10 但是用户是一个用户吧?我这个路飞头像是可以直接到另一个帐号的= =哈哈
    DeathWing
    DeathWing
    OP
    Oct 1, 2020
    9
    @sola97 和我一模一样的情况?
    DeathWing
    DeathWing
    OP
    Oct 1, 2020
    10
    @Kr98 我觉得应该不是路飞小哥绑了那个邮箱=。=
    Exin
    Exin
    Oct 1, 2020
    11
    羡慕你们有头像的,我总是显示不出头像来
    BIAOXYZ
    BIAOXYZ
    Oct 1, 2020
    12
    把本地所有的 config 都核对一下( git config -l + --system/--global/--local )。
    lxilu
    lxilu
    Oct 1, 2020 via iPhone
    13
    前贴 Github 奇葩项目提到伪造作者或可参考
    DeathWing
    DeathWing
    OP
    Oct 2, 2020
    14
    @lxilu 搜了一下 没怎么找到~方便的话 能不能贴一下链接 我去观摩下
    DeathWing
    DeathWing
    OP
    Oct 2, 2020
    15
    @Exin - -?为啥显示不出来
    DeathWing
    DeathWing
    OP
    Oct 2, 2020
    16
    @BIAOXYZ 这个不是主要问题,主要是脚本 commit 的时候用的 [email protected],而这个邮箱在 github 上对应的是路飞头像。
    另外,config 这个第一时间确认过了,除了 system 没有设置外其他都是我自己。我后来推测是因为在我的环境下使用 subprocess 读取不到 user config,所以我在脚本里每次提交前添加了一下 username 和 Email 就搞定了。主要是路飞这个太诡异了=。=
    yanqiyu
    yanqiyu
    Oct 3, 2020
    17
    建议发邮件直接请教
    DeathWing
    DeathWing
    OP
    Oct 9, 2020
    19
    @yanqiyu If you add an email to your account, and commit using that email, it will be attributed to your account. It doesn’t need to be verified.
    DeathWing
    DeathWing
    OP
    Oct 10, 2020
    20
    简单复现了一下,确实只要在账户设置里添加邮箱,不需要验证。
    基本结帖啦。后续无聊想验证的可以用 [email protected],应该也会显示我的猫头像
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1304 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 37ms · UTC 21:37 · PVG 05:37 · LAX 13:37 · JFK 16:37
    ♥ Do have faith in what you're doing.