Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git force push with IntelliJ IDE

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?

like image 627
quarks Avatar asked Mar 14 '20 13:03

quarks


1 Answers

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:

like image 123
grg Avatar answered Nov 08 '22 19:11

grg