Advertisement
Guest User

Untitled

a guest
Apr 25th, 2017
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. DEFAULT_NAME="$(git config user.name)"
  2. DEFAULT_EMAIL="$(git config user.email)"
  3. export OLD_NAME="${1:-$DEFAULT_NAME}"
  4. export NEW_NAME="${2:-$DEFAULT_NAME}"
  5. export NEW_EMAIL="${3:-$DEFAULT_EMAIL}"
  6.  
  7. echo "Old:" $OLD_NAME "<*>"
  8. echo "New:" "$NEW_NAME <$NEW_EMAIL>"
  9. echo "To undo, use: git reset $(git rev-parse HEAD)"
  10.  
  11. git filter-branch --env-filter \
  12. 'if [ "$GIT_AUTHOR_NAME" = "${OLD_NAME}" ]; then
  13. export GIT_AUTHOR_NAME="${NEW_NAME}"
  14. export GIT_AUTHOR_EMAIL="${NEW_EMAIL}"
  15. export GIT_COMMITTER_NAME="${NEW_NAME}"
  16. export GIT_COMMITTER_EMAIL="${NEW_EMAIL}"
  17. fi'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement