I am trying to hard reset the master branch, so it mirrors the current state of our ‘develop’ branch.
We do not care for any old commits on master and want to rewrite it’s history. I should note, that we are using a self-hosted Git server called ‘SCM-Manager’ (no GitHub or similar services). I do have ‘owner’ privileges on the repository.
I am using the following command to force push the Develop’s state to Master:
git push origin +develop:master --no-verify --force
But I keep getting this error message:
! [rejected] develop -> master (non-fast-forward)
error: failed to push some refs to 'https://****.git'
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.
Any help is highly appreciated.

master -> masterin the error message means your Git attempted to set theirmasterto the same commit hash that is stored in yourmaster. But yourgit push origin +develop:mastershould have your Git using the hash stored in yourdevelop. Something here does not add up, in other words.receive.denyFastForwardsgit config variable in your server repo? This config variable could cause the server repo to reject. I don't think this is the case, though, because the error message is (at least for me) different when the push is rejected because of that config variable.--forcethat has to be in front of[<repository> [<refspec>…]], like ingit push --no-verify --force origin +develop:master.