Usecase
Gitログのユーザ情報を修正
異なるユーザアカウントでcommit, push等してしまったとき
Fix committer
git config --local user.name [user_name]
git config --local user.email [user_email]
git commit --amend
Fix author
git commit --amend --author="[user_name] <[user_email]>"
Fix all-log
過去のログ全てを修正
$ git filter-branch -f --env-filter "GIT_AUTHOR_NAME='[user_name]'; GIT_AUTHOR_EMAIL='[user_email]'; GIT_COMMITTER_NAME='[user_name]'; GIT_COMMITTER_EMAIL='[user_email]';" HEAD
Push
既にpush済のログを修正する場合,force pushを行う
git push -f
最終更新日:
August 14, 2023
作成日: August 14, 2023
作成日: August 14, 2023