![](/style/images/good.png)
![](/style/images/bad.png)
Re-writing previous git commits to change committer author/email
source link: https://www.kevinhooke.com/2021/12/26/re-writing-previous-git-commits-to-change-committer-author-email/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Re-writing previous git commits to change committer author/email
If you’ve committed a number of git commits using a wrong user.name or user.email value, you can re-write previous commits with:
git filter-branch --commit-filter ' if [ "$GIT_COMMITTER_NAME" = "Old Name" ]; then GIT_COMMITTER_NAME="new-name"; GIT_AUTHOR_NAME="new-name"; GIT_COMMITTER_EMAIL="new-email"; GIT_AUTHOR_EMAIL="new-email"; git commit-tree "$@"; else git commit-tree "$@"; fi' HEAD
Note that this will re-write all commits on the current branch matching the if condition which may or may not be what you’re looking for, so be careful. push the changes back to your remote origin as needed.
This is based on answers to this question here.
Related
Removing commit history in GitAugust 29, 2012In "Tech Notes"
Git notesMay 4, 2012In "Tech Notes"
Git in a nutshellFebruary 3, 2012In "Tech Notes"
CategoriesKev's BlogTagsgit, github, version control
Leave a Reply Cancel reply
Your email address will not be published. Required fields are marked *
Comment
Name *
Email *
Website
Save my name, email, and website in this browser for the next time I comment.
Notify me of follow-up comments by email.
Notify me of new posts by email.
This site uses Akismet to reduce spam. Learn how your comment data is processed.
Post navigation
Recommend
-
64
-
52
-
43
小米从2012年开始正式涉足开源,不光积极参与开源社区,修复bug,提交代码,同时逐渐将自研的系统或框架进行开源,先后开源了企业级、高可用、可扩展的...
-
36
“ 任何人的成功都不是偶然的,成为Committer也不是一夜成名的事情,都是要经过不断的持续努力。 到一定程度某些信号会释放给你,本篇将 向 你详细介绍如何才能收到...
-
50
1. 介绍 经过Apache Hudi项目委员会讨论及投票,向 Udit Mehrotra、Gary Li、Raymond Xu、Pratyaksh Sharma 4人发出Committer邀请,4人均已接受邀请并顺利成为Committer,也使得Apache Hudi Committer成员在...
-
22
他是第一期 Talent plan 的学员,也是第一期易用性挑战赛优秀参赛选手, 拥有多个身份的他成为了 TiDB 新晋 Committer,他就是来自 Execution SIG 的马钰杰(mmyj) 。 他是游戏云玩家,也喜欢研...
-
5
Committer Models of Unladen Swallow, PyPy, and Django Thu, Feb 25, 2010During this year’s PyCon I became a committer on both PyPy and Unladen Swallow, in addition I’ve been a contributer to Django for quite a long time (as we...
-
4
如何从一名开源小白成长为Apache Committer 少于 1 分钟 阅读 如何从一名开源小白成长为Apache Committer 今天收到了来自Apache...
-
7
1. 介绍 经过Apache Hudi项目委员会讨论及投票,向 WangXiangHu和LiWei 2人发出Committer邀请,2人均已接受邀请并...
-
3
reset author for ALL commits · GitHub Instantly share code, notes, and snippets.
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK