Change the author of your local repository

git rebase or when you wish to make changes to only the last commit

git commit --amend --author="New Author Name <new.email@example.com>"

Push to a remote repository

git push origin main --force

Rename the default branch on Github

Visit your GitHub repository. Change the default branch name from “main” to “main2”. After making the change, revert the default branch name back to “main”.