You can block force pushes (git push --force) on all branches—or just the default branch—of a user's repositories.

Each repository inherits a default setting from its owner (an organization or user account). You can override this default setting unless the repository's owner has chosen to enforce the setting on all of its repositories.

  1. Search for a user account from the Command Bar (or go directly to its URL).

  2. Click the "Admin tools" button at the top of the page.

    Admin Tools

  3. Select Admin from the menu on the left side of the page.

    Admin Tools

  4. Select Block or Block to the default branch under Force pushes.

    Block force pushes

  5. Optionally select Enforce on all repositories to block force pushes on all repositories owned by the user account.

    Block force pushes

The change takes effect immediately. If you change your mind later, you can easily re-allow force pushes at the same location in the admin tools.

Further reading