I've searched the documentation and online also, but I can seem to find a way to do Git force push aka git push --force
with IntelliJ, it is easy to do with the command line but how can you do it within the IDE itself?
From the Push window (Ctrl/cmd-shift-K), the Push button has a down arrow to reveal a dropdown option ‘Force Push’. This will perform at first a --force-with-lease
, which if fails, will prompt a --force
push.
If your branch is trying to push to master, ‘Force Push’ is grey. To enable force push to master, remove it from the list of protected branches in Preferences → Git:
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