Code hosting platform

Force Push Protection

New Features

It happens to every team, someone force-pushes to the repository and overwrites the branch, instead of pulling and merging changes like they should. We want to make this a thing of the past, so today we're introducing force-push protection.

Force-push protection is enabled by default for every Git repository in Codebase. Anybody attempting to overwrite a branch with git push --force will be presented with the following message:

Rejected Force Push

If a force push is really required, force-push protection can be turned off in Repository Settings, just set "Allow Force Pushes?" to "Yes - allow force pushes". Once this is done, force pushes will be allowed, but they'll be logged on the activity feed as a forced push.

Logged Force Push

The future

Initially, force-push protection is only for Git, but we'll be extending this functionality to Mercurial as soon as possible.

Currently force-push protection can only be applied to the entirety of a repository, however now we have the appropriate framework in place, we should in future be able to restrict pushing to specific branches on a per-user basis. This will allow teams to have an enforced workflow using merge-requests, or another merging strategy of their choice.

A little bit about the author

My name is Dan. My primary role at aTech is to develop and maintain our hosted applications, such as Codebase and Deploy. I'm often the person who responds to helpdesk tickets where further investigation is needed. My preferences include; beer over lager, dogs over cats, coffee over tea and cars from the 80s.