gandreadis
gandreadis

Reputation: 3242

Have IntelliJ warn me before committing to master

Is it possible to have IntelliJ IDEA warn me before committing to the master branch? I find myself frequently committing changes to master that I should really be putting on a feature-branch, and sometimes I notice this only after a few commits. It is not difficult to undo this mistake and move the commits to a new branch, but I'd prefer not having to do it, in the first place.

Upvotes: 3

Views: 825

Answers (1)

Dmitrii Smirnov
Dmitrii Smirnov

Reputation: 7528

There is no way to do this.

The great thing in git, as you noted, is the fact that you could easily revert/move wrong commits to the correct branch. Adding warnings or confirmation doesn't seem like a good idea because they tend to be ignored by habit in time and become just an unnecessary step.

Probably what you need here is a more clear indication which branch the commit will go to. Please vote for https://youtrack.jetbrains.com/issue/IDEA-63893.

Upvotes: 1

Related Questions