Followed these steps to remove some content from my repository.
However, when I did a git push
, I got the below message:
Writing objects: 100% (28/28), 6.72 KiB | 1.34 MiB/s, done. Total 28 (delta 18), reused 18 (delta 9) remote: error: denying non-fast-forward refs/heads/master (you should pull first) remote: error: denying non-fast-forward refs/heads/multiplicity_refinement (you should pull first) To ssh://path_to_repo/repo_name.git ! [remote rejected] master -> master (non-fast-forward) ! [remote rejected] multiplicity_refinement -> multiplicity_refinement (non-fast-forward) error: failed to push some refs to 'ssh://path_to_repo/repo_name.git'
By default, Git refuses to push any commits to an existing branch if doing so would lose commits already pushed. When you use BFG Cleaner or any other tool that rewrites your history, the commits you've made are rewritten and appear different from the existing commits (which they are). If you're sure you want to push those changes anyway, you'd need to use the --force
flag: git push --force origin master
.
You can run git push --help
to see more information about --force
and why it's necessary.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With