项目作者: osubuu

项目描述 :
Small Shell script to automate the revision of author info in a repository's commit history
高级语言: Shell
项目地址: git://github.com/osubuu/git-author-history-fix.git
创建时间: 2020-04-10T23:00:57Z
项目社区:https://github.com/osubuu/git-author-history-fix

开源协议:

下载


git-author-history-fix

Small Shell script to automate the revision of author info in a repository’s commit history via command line. The steps were taken from GitHub’s help page.

1. Modify history.sh script with proper email information

Change OLD_EMAIL, CORRECT_NAME and CORRECT_EMAIL to the correct values

  1. git filter-branch --env-filter '
  2. OLD_EMAIL="bademail@example.com"
  3. CORRECT_NAME="Eric"
  4. CORRECT_EMAIL="goodemail@example.com"
  5. if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
  6. then
  7. export GIT_COMMITTER_NAME="$CORRECT_NAME"
  8. export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL"
  9. fi
  10. if [ "$GIT_AUTHOR_EMAIL" = "$OLD_EMAIL" ]
  11. then
  12. export GIT_AUTHOR_NAME="$CORRECT_NAME"
  13. export GIT_AUTHOR_EMAIL="$CORRECT_EMAIL"
  14. fi
  15. ' --tag-name-filter cat -- --branches --tags

2. Run the script via command line

  1. . history.sh git@github.com:username/repository-name.git