代码之家  ›  专栏  ›  技术社区  ›  erikvold

有没有什么方法可以伪造我要做的git提交的作者的名字/电子邮件信息?

git
  •  3
  • erikvold  · 技术社区  · 15 年前

    我已经手工挑选了一个提交到我的git项目中的项目,我想通过伪造这个提交的作者信息来表扬真正的作者,所以真正的作者就是作者,而我就是提交者。

    你知道怎么做吗?

    2 回复  |  直到 15 年前
        1
  •  5
  •   Andomar    15 年前

    您可以将author指定为 git commit

    git commit --author='Erik Vold <ErikVold@gmail.com>' ....
    
        2
  •  7
  •   Jörg W Mittag    15 年前

    GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL --author 论据 git commit 根据 the documentation :

    --author= <author>
    重写提交作者。使用标准指定显式作者 A U Thor <author@example.com> <author> 假设是一种模式,用于搜索该作者现有的提交(即。 rev-list --all -i --author= <author> ); 然后从找到的第一个提交复制提交作者。

    然而,你其实不需要这么做 任何东西 因为 git cherry-pick 已经自动完成了。