This version of GitHub Enterprise will be discontinued on This version of GitHub Enterprise was discontinued on 2020-01-22. No patch releases will be made, even for critical security issues. For better performance, improved security, and new features, upgrade to the latest version of GitHub Enterprise. For help with the upgrade, contact GitHub Enterprise support.

Blocking force pushes on your appliance

Any site administrator can block all force pushes (git push --force) on a GitHub Enterprise Server appliance

Each repository inherits a default force push setting from the settings of the user account or organization to which it belongs. Likewise, each organization and user account inherits a default force push setting from the force push setting for the entire appliance. If you change the force push setting for the appliance, it will change for all repositories owned by any user or organization.

  1. In the upper-right corner of any page, click .

    Rocketship icon for accessing site admin settings

  2. In the left sidebar, click Business.

    Business tab in the Site admin settings

  3. Under your business account's name, click Settings.

    Settings tab on the business account profile page

  4. In the left sidebar, click Options.

    Options tab in the business account settings sidebar

  5. Under "Force pushes", use the drop-down menu, and click Allow, Block or Block to the default branch.

    Force pushes dropdown

  6. Optionally, select Enforce on all repositories, which will override organization and repository level settings for force pushes.

Further reading

Ask a human

Can't find what you're looking for?

Contact us