| 作者 | git commit --author='Name <email>' 或修订历史保留的原作者 |
|---|---|
| 提交者 | 执行提交时的 user.name/user.email,可用 GIT_COMMITTER_* 覆盖 |
| 场景 | 代他人提交、rebase 重放、邮件补丁应用 |
查看与覆盖
查看与覆盖
git log --format='%h A:%an C:%cn' -5
git commit --author='Alice <alice@example.com>' -m 'fix: 采纳同事补丁'
GIT_COMMITTER_NAME=bot GIT_COMMITTER_EMAIL=bot@example.com git commit -m 'chore: 自动同步'导入外部补丁(如 git am)保留原作者、提交者记为当前用户;贡献统计通常按作者归属。