I went to push work to my master branch but I get this error:
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'https://github.com/Machinas/esprit-rwd'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushin
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
I don't want to fetch the update another person commited as it was a mistake on their part, how can I just push and ignore that commit? Thanks
If you are really really sure that the other commits are not relevant, you can do a force push:
git push --force-with-lease <remote> <branch>
WARNING: if anyone else has already pulled the wrong commit, you will make them unhappy. And the person who made the wrong commit, should better get a new clone of your repo.
EDIT: changed --force to --force-with-lease because the latter is a bit less dangerous. This Atlassian blog post explains why.
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