Skip to content

Latest commit

 

History

History
14 lines (12 loc) · 562 Bytes

git-rewrite-history.md

File metadata and controls

14 lines (12 loc) · 562 Bytes

Change the commit author of all commits while keeping the original commit date

git rebase --root --exec 'git commit --amend --no-edit --reset-author --date="$(git log -n 1 --format=%aD)"'

Remove the signed-off-by signature

git rebase --root --exec 'git commit --amend --no-edit --reset-author --date="$(git log -n 1 --format=%aD)" -m "$(git log --format=%B -n 1 | head -n -3 )"'

Sign off the commits again

git rebase --root --exec 'git commit --amend --no-edit --reset-author --date="$(git log -n 1 --format=%aD)" -s'