Enable Force Push on IntelliJ

IntelliJ protects master and main branches from force push by default. After a series of bad test commits accumulated during GitHub Actions debugging, I needed to clean up the history — here's how to remove that protection.

Scenario

To automate deployment using GitHub Actions, I encountered several syntax errors.
As a result, messy test code was left in the commit log, and I needed to enable force push to clean it up.

Solution

open search everywhere modify protected branch

  • Step 0: Press the shortcut keys Ctrl + Shift + A to open the Search Everywhere window.
  • Step 1: In the Search Everywhere window, type "Protected branches:" and click on the matching item.
  • Step 2: In the settings window, locate the Protected branches: field and delete its contents.

Troubleshooting

Since GitHub and GitLab have branch protection features, you need to check the settings of each repository.

Created : 07/21/25 Modified : 04/13/26
Designed by