git commit amend author code example
Example 1: Change Git commit user name and author
git commit --amend --author="Author Name <[email protected]>"
git rebase -i B
git rebase -i --root
git commit --amend --author="Author Name <[email protected]>"
git rebase --continue
git commit --amend --author="Author Name <[email protected]>"
git rebase --continue
git push -f
Example 2: amend last commit message
$ git commit --amend -m "New and correct message"
Example 3: git amend last commit message
$ git commit --amend -m "New and correct message"
Example 4: git change commit author for all commits
git rebase -i --root -x "git commit --amend --author='YOUR_USERNAME <[email protected]> --no-edit'"