Reputation: 35276
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?
Upvotes: 23
Views: 13044
Reputation: 5839
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:
Upvotes: 49