V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
git
Pro Git
Atlassian Git Tutorial
Pro Git 简体中文翻译
GitX
DeathWing
V2EX  ›  git

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

  •  
  •   DeathWing · 2020-10-01 11:38:24 +08:00 · 3763 次点击
    这是一个创建于 1302 天前的主题,其中的信息可能已经有所发展或是发生改变。

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

    重点来了!!!

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

    20 条回复    2020-10-10 09:18:30 +08:00
    DeathWing
        1
    DeathWing  
    OP
       2020-10-01 11:52:26 +08:00
    [Imgur]( )
    ericwood067
        2
    ericwood067  
       2020-10-01 11:59:00 +08:00
    []( 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
        3
    DeathWing  
    OP
       2020-10-01 12:03:20 +08:00
    @ericwood067 那他把 [email protected] 加到了他账户里?这。。好像说不通
    ericwood067
        4
    ericwood067  
       2020-10-01 12:08:37 +08:00   ❤️ 1
    @DeathWing 应该是这样的,github 的 settings 里有一个 Emails,里面有一个 Add email address 的选项。
    Kr98
        5
    Kr98  
       2020-10-01 12:09:56 +08:00 via Android
    @ericwood067 关键是他怎么通过邮箱验证的
    ODD10
        6
    ODD10  
       2020-10-01 13:42:23 +08:00 via iPhone
    我用 mac 和 ios 提交,头像不一样。
    一个是旧的头像,一个是新的头像。

    用的 vscode 和 working copy
    sola97
        7
    sola97  
       2020-10-01 14:00:12 +08:00
    我也遇到过
    DeathWing
        8
    DeathWing  
    OP
       2020-10-01 14:21:32 +08:00
    @ODD10 但是用户是一个用户吧?我这个路飞头像是可以直接到另一个帐号的= =哈哈
    DeathWing
        9
    DeathWing  
    OP
       2020-10-01 14:21:45 +08:00
    @sola97 和我一模一样的情况?
    DeathWing
        10
    DeathWing  
    OP
       2020-10-01 14:22:40 +08:00
    @Kr98 我觉得应该不是路飞小哥绑了那个邮箱=。=
    Exin
        11
    Exin  
       2020-10-01 22:00:37 +08:00
    羡慕你们有头像的,我总是显示不出头像来
    BIAOXYZ
        12
    BIAOXYZ  
       2020-10-01 23:22:38 +08:00
    把本地所有的 config 都核对一下( git config -l + --system/--global/--local )。
    lxilu
        13
    lxilu  
       2020-10-01 23:35:29 +08:00 via iPhone
    前贴 Github 奇葩项目提到伪造作者或可参考
    DeathWing
        14
    DeathWing  
    OP
       2020-10-02 20:22:36 +08:00
    @lxilu 搜了一下 没怎么找到~方便的话 能不能贴一下链接 我去观摩下
    DeathWing
        15
    DeathWing  
    OP
       2020-10-02 20:22:54 +08:00
    @Exin - -?为啥显示不出来
    DeathWing
        16
    DeathWing  
    OP
       2020-10-02 20:26:16 +08:00
    @BIAOXYZ 这个不是主要问题,主要是脚本 commit 的时候用的 [email protected],而这个邮箱在 github 上对应的是路飞头像。
    另外,config 这个第一时间确认过了,除了 system 没有设置外其他都是我自己。我后来推测是因为在我的环境下使用 subprocess 读取不到 user config,所以我在脚本里每次提交前添加了一下 username 和 Email 就搞定了。主要是路飞这个太诡异了=。=
    yanqiyu
        17
    yanqiyu  
       2020-10-03 01:37:27 +08:00
    建议发邮件直接请教
    lxilu
        18
    lxilu  
       2020-10-03 10:39:51 +08:00
    DeathWing
        19
    DeathWing  
    OP
       2020-10-09 18:16:31 +08:00
    @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
        20
    DeathWing  
    OP
       2020-10-10 09:18:30 +08:00
    简单复现了一下,确实只要在账户设置里添加邮箱,不需要验证。
    基本结帖啦。后续无聊想验证的可以用 [email protected],应该也会显示我的猫头像
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3128 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 14:43 · PVG 22:43 · LAX 07:43 · JFK 10:43
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.