Possible duplicate, but I hit the following issue when using those answers.
Situation:
I didn't set up my github locally when I pushed a commit so the author information is incorrect. I've now set the global user.name and email correctly. But I would like to update that commit with the new information.
Attempt: Starting from the origin
git checkout my_branch
git pull
git commit --amend --author="My Name <me@example.com>" --no-edit
git push
triggers the following error:
! [rejected] mybranch -> mybranch (non-fast-forward)
error: failed to push some refs to 'https://github.com/xyz'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
What is the correct way to pass the update to the live repo?