1. 程式人生 > >修改git commit資訊中的author

修改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 結束脩改