Hallo, Entdecker! An dieser Seite wird aktiv gearbeitet, oder sie wird noch übersetzt. Die neuesten und genauesten Informationen findest Du in unserer englischsprachigen Dokumentation.

Enabling force pushes to a protected branch

You can allow force pushes to a protected branch.

Geschützte Branches sind verfügbar in öffentlichen Repositorys mit GitHub Free und GitHub Free für Organisationen, und in öffentlichen und privaten Repositorys mit GitHub Pro, GitHub Team, GitHub Enterprise Cloud, und GitHub Enterprise Server.

Inhalt dieses Artikels

Did this doc help you?

Help us make these docs great!

All GitHub docs are open source. See something that's wrong or unclear? Submit a pull request.

Make a contribution

Oder, learn how to contribute.

Anyone with admin permissions to a repository can enable force pushes.

About force pushes to protected branches

By default, force pushes are blocked on all protected branches. When you enable force pushes to a protected branch, anyone with at least write permissions to the repository can force push to the branch, including those with admin permissions.

Enabling force pushes will not override any other branch protection rules. For example, if a branch requires a linear commit history, you cannot force push merge commits to that branch.

You cannot enable force pushes for a protected branch if a site administrator has blocked force pushes to all branches in your repository. For more information, see "Blocking force pushes to repositories owned by a user account or organization."

If a site administrator has blocked force pushes to the default branch only, you can still enable force pushes for any other protected branch.

Du kannst geschützte Branch-Einstellungen automatisch für einige oder alle Branches in Deinem Repository erzwingen. Weitere Informationen finden Sie unter „Geschützte Branches konfigurieren“.

Enabling force pushes

  1. Navigiere in GitHub Enterprise zur Hauptseite des Repository.
  2. Klicke unter Deinem Repository-Namen auf Settings (Einstellungen).
    Schaltfläche „Repository settings" (Repository-Einstellungen)
  3. Klicke im linken Menü auf Branches.
    Untermenü „Repository options" (Repository-Optionen)
  4. Klicke neben „Branch protection rules" (Branch-Schutzregeln) auf Add rule (Regel hinzufügen.)
    Schaltfläche „Add branch protection rule" (Füge Branch-Schutzregel hinzu)
  5. Gib unter „Branch name pattern" (Branch-Namensmuster) den Branch-Namen oder das Muster ein, das Du schützen möchtest.
    Feld „Branch rule" (Branch-Regel)
  6. Under "Rules applied to everyone including administrators", select Allow force pushes.
    Allow force pushes option
  7. Click Create.

Did this doc help you?

Help us make these docs great!

All GitHub docs are open source. See something that's wrong or unclear? Submit a pull request.

Make a contribution

Oder, learn how to contribute.