Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## Make sure your local repo settings are correct
- git config --local --list
- git config --local user.name "author name"
- git confit --local user.email "name@example.com"
- ## Change previous n commits
- git rebase -i HEAD~n
- # choose the commits to change by adding 'pick' or 'reword' (only for changing the message)
- git commit --amend --author="Author Name <email@address.com>"
- ## Change all commits with --commit-filter. If your local config was wrong
- git filter-branch --commit-filter 'if [ "$GIT_AUTHOR_NAME" = "your previous name" ];
- then export GIT_AUTHOR_NAME="your New Name"; export GIT_AUTHOR_EMAIL=new.email@example.com;
- export GIT_COMMITTER_NAME="your New Name"; export GIT_COMMITTER_EMAIL=new.email@example.com
- fi; git commit-tree "$@"'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement