Skip to main content

Git 修改 author/committer

· One min read

修改 Author,可以 commit 時修改也可以事後修改

$ git commit -m "Test" --author "HungWei Chiu<[email protected]>"
$ git commit --amend --author "HungWei Chiu<[email protected]>" --no-edit

如果想要連 commit 一起修改且長期使用,比較簡單的方式就是直接設定 local user/email

$ git config --local user.email "[email protected]"
$ git config --local user.name "HungWei Chiu"

針對當前 commit 可以採用 --reset-author 的方式來修正

git commit  --amend --no-edit --reset-author