xxxxxxxxxx
# Changes the username and email of all commits from the start.
git rebase -i --root -x "git commit --amend --author='YOUR_USERNAME <user@example.com> --no-edit'"
xxxxxxxxxx
git commit --amend --author="Author Name <email@address.com>" --no-edit
xxxxxxxxxx
git rebase -i HEAD~2
git commit --amend --author="Cesar Bueno <cesar.bueno.tx@gmail.com>"
git rebase --continue
xxxxxxxxxx
$ git commit --amend --author="John Doe <john@doe.org>" --no-edit
$ git rebase --continue
xxxxxxxxxx
git rebase -i --root --exec 'git commit --amend --reset-author --no-edit'
xxxxxxxxxx
Reset your username to the config globally: git config --global user.name example.
Reset your email to the config globally: git config --global user.email example@email.com.
Now reset the author of your commit without edit required: git commit --amend --reset-author --no-edit.
xxxxxxxxxx
git commit --amend --author="Muhammad Faisal Ameen <faisal.ameen@synviz.com>"
after above command edit commit message
press :q to save changes
before push check git history(vs) or git log (cmd)
xxxxxxxxxx
git rebase -i YOUR_SHA -x "git commit --amend --author 'New Name <new_address@example.com>' -CHEAD"
xxxxxxxxxx
git config --global user.name "John Doe"
git config --global user.email johndoe@example.com
git rebase -i YOUR_SHA -x "git commit --amend --reset-author -CHEAD"
xxxxxxxxxx
# just run this code
git filter-branch --env-filter '
OLD_EMAIL="YOUR WRONG EMAIL HERE"
CORRECT_NAME="YOUR CORRECT NAME HERE"
CORRECT_EMAIL=<YOUR CORRECT EMAIL HERE>
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
export GIT_COMMITTER_NAME="$CORRECT_NAME"
export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL"
fi
if [ "$GIT_AUTHOR_EMAIL" = "$OLD_EMAIL" ]
then
export GIT_AUTHOR_NAME="$CORRECT_NAME"
export GIT_AUTHOR_EMAIL="$CORRECT_EMAIL"
fi
' --tag-name-filter cat -- --branches --tags