Skip to content

Explain different default contexts (fx with and without branch protection) #18936

@alexgenaud

Description

@alexgenaud

Code of Conduct

What article on docs.github.com is affected?

https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/about-protected-branches

What part(s) of the article would you like to see updated?

Some note regarding "default" behavior explicitly, would be helpful.

The documentation may be strictly correct, but certain assumed or non-obvious interpretation of "default" is likely confusing (it was for me). I assume "default" means "always without any overriding setting there is one and only one presumed value". To my surprise, "default" is contextual and may mean the exact opposite in different contexts.

The specific example I ran into (though there are numerous examples):

By default, in both git and github, 'git push --force' is allowed, even to master.
However, with branch protection enabled, then by default 'git push --force' is not allowed, by default.
The documentation clearly states that allow_force_pushes = false is default.
But it's only default in that context and not default (opposite default) in the default context (no branch protection).

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    contentThis issue or pull request belongs to the Docs Content team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions