4


I am trying to change the author name of last commit. As mentioned in Change commit author at one specific commit, I am executing git commit --amend --author="Author Name <email@address.com>" command.
In my git log I can see that name and email have been changed.
But when I am executing git push -f, it is giving me following error

remote: To prevent you from losing history, non-fast-forward updates were rejected.
! [remote rejected] dev -> dev (pre-receive hook declined)

Any idea how can i push this.

Thanks,
Shantanu

Community
  • 1
  • 1
shantanu
  • 1,748
  • 3
  • 19
  • 34

1 Answers1

2

Your remote server is preventing the push. You need to (temporarily) configure it to permit pushing non-fast-forward changes for that branch to achieve what you want. How you do that depends on which server you are using; for example, if it's a bare Git repository on a server you can change it with git config receive.denyNonFastForwards false.

AlBlue
  • 23,254
  • 14
  • 71
  • 91