Git 客製化工具
change-commits
修改 commit 的 username, email
$ git config --global alias.change-commits '!'"f() { VAR=\$1; OLD=\$2; NEW=\$3; shift 3; git filter-branch --env-filter \"if [[ \\\"\$\`echo \$VAR\`\\\" = '\$OLD' ]]; then export \$VAR='\$NEW'; fi\" \$@; }; f"
- change author name
$ git change-commits GIT_AUTHOR_NAME "old name" "new name"
- change author email with last 10 commits
$ git change-commits GIT_AUTHOR_EMAIL "old@email.com" "new@email.com" HEAD~10..HEAD