push-f fails for git amend commit

Asked 5 months ago, Updated 5 months ago, 12 views

I wanted to change the Author of the commit, so I did the following procedure, but push-f fails.
What should I do?

$git commit --amend --author='foo<[email protected]>'
$ git rebase -- continue
No rebase in progress?

(Check the git log for corrections)

$git push origin master-f
Counting objects: 4, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 497 bytes | 0 bytes/s, done.
Total 4 (delta 3), reused 0 (delta 0)
remote:error:denying non-fast-forward refs/heads/master(you should pull first)
 ! [remote rejected] master->master (non-fast-forward)
error: failed to push some refs to 'ssh://****'

git version 2.4.4


2022-09-30 11:30

1 Answers

If you set denyNonFastForwards to false in the config of the repository to push, you can force it through with git push-f.


2022-09-30 11:30

If you have any answers or tips

© 2023 OneMinuteCode. All rights reserved.