jesseduffield / lazygit

simple terminal UI for git commands
MIT License
48.13k stars 1.73k forks source link

Feature for protection against pushing to remote main/master #3716

Open trskare opened 3 days ago

trskare commented 3 days ago

If you forget to switch branch from master/main and press the key P or perhaps you meant to press p (for pulling) you could in theory do something that could have a big consequence if you work against a repo that are used for CD/gitops/configuration management. Sure! Those repos should definitely have branch protection in place anyway to disable force pushing, only merge commits thru PR/branches etc, but lets think worst case scenario and say someone forgets to enable them or they are temporarily disabled.

What about optional protection feature that will give you a big warning you if you try to push against remote master/main branches?