Advertisement
Guest User

Untitled

a guest
Nov 21st, 2019
461
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. # Run with 'changeAuthor "{old email}" "{new name}" "{new email}"
  2. changeAuthor() {
  3. WRONG_EMAIL="$1"
  4. NEW_NAME="$2"
  5. NEW_EMAIL="$3"
  6.  
  7. git filter-branch -f --env-filter '
  8. if [ $GIT_COMMITTER_EMAIL = $WRONG_EMAIL ]
  9. then
  10. export GIT_COMMITTER_NAME="${NEW_NAME}"
  11. export GIT_COMMITTER_EMAIL=$NEW_EMAIL
  12. fi
  13. if [ $GIT_AUTHOR_EMAIL = $WRONG_EMAIL ]
  14. then
  15. export GIT_AUTHOR_NAME="${NEW_NAME}"
  16. export GIT_AUTHOR_EMAIL=$NEW_EMAIL
  17. fi
  18. ' --tag-name-filter cat -- --branches --tags
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement