push-f fails for git amend commit

Asked 2 years ago, Updated 2 years ago, 51 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)
Tosssh://*****
 ! [remote rejected] master->master (non-fast-forward)
error: failed to push some refs to 'ssh://****'

git version 2.4.4

git

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.

 [receive]
    denyNonFastforwards=false


2022-09-30 11:30

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.