Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git push to remote not accepting

Tags:

git

git-push

My remote is configured not to accept non-fast-foward commits.

The remote version is completely different from my local version. I want to override it. I dont want to merge or rebase anything. Moreover, my local repository started as a clean git init, not pulling from the server.

I did git push origin master --f but I get

remote: error: denying non-fast-forward refs/heads/master (you should pull first)

I dont want to pull because it will merge with my version and I dont want.

What's the right procedure to follow?

like image 397
Tony Avatar asked Apr 24 '26 00:04

Tony


1 Answers

It’s either git push -f origin master or git push --force origin master but git push --f won’t work.

like image 86
Benedikt Waldvogel Avatar answered Apr 25 '26 18:04

Benedikt Waldvogel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!