Skip to main content

轻松上手Git

huhxLess than 1 minute

修改已提交commit的用户名和邮箱

git rebase -r {{commit-hash-before}} \
    --exec 'git commit --amend --no-edit --author "Tom <xxx@email.com>"'

邮箱处的<>很容易被忽略,比如有三次提交分别是hashA, hashB, hashC

git rebase -r hashC \
    --exec 'git commit --amend --no-edit --author "Tom <go@qq.com>"'

上述命令是修改hashAhashB的这两次提交信息,名字 -> Tom,邮箱 -> go@qq.com