git-rebase-preserve-author() { git rebase --preserve-merges $1 root_dir=(git rev-parse --show-toplevel) while [[ -f ${root_dir}/.git/rebase-merge/stopped-sha ]]; do stopped_sha=(cat ${root_dir}/.git/rebase-merge/stopped-sha) git_author_string=(git show -s --format='%an <%ae>' ${stopped_sha}) for c in (git diff --name-only --diff-filter=U); do eval ${EDITOR} ${root_dir}/$c done git commit --all--author=${git_author_string} git rebase --continue done }