修改git commit信息中的author


话说不是经常有忘记修改git 的author 和email 就直接提交的情况嘛。

这个时候就需要修改commit 中的author信息啦


1> rebase 到你要修改的那一条commit

    git rebase -i <commit_hashcode>


2> 这个时候会出现一个文本编辑界面内容大概如下, 把你要改的commit 前面的pick替换成edit,然后输入wq退出

    pick <hashcode1>  <commit_message1>

pick <hashcode2>  <commit_message2>

pick <hashcode3>  <commit_message3>

pick <hashcode4>  <commit_message4>


3>使用--amend 修改 author 

    git commit --amend --author=‘xxx <[email protected]>’


4>输入git rebase --continue 结束修改

猜你喜欢

转载自blog.csdn.net/chinafire525/article/details/80296276