Binary file not shown.
|
After Width: | Height: | Size: 36 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 42 KiB |
@@ -14,6 +14,7 @@ children:
|
||||
- /managing-the-forking-policy-for-your-repository
|
||||
- /managing-pull-request-reviews-in-your-repository
|
||||
- /managing-the-commit-signoff-policy-for-your-repository
|
||||
- /managing-the-push-policy-for-your-repository
|
||||
- /managing-git-lfs-objects-in-archives-of-your-repository
|
||||
- /enabling-anonymous-git-read-access-for-a-repository
|
||||
- /about-email-notifications-for-pushes-to-your-repository
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
---
|
||||
title: Managing the push policy for your repository
|
||||
intro: You can limit how many branches and tags can be updated in a single push.
|
||||
versions:
|
||||
feature: limit-branches-tags-in-push
|
||||
permissions: People with admin permissions for a repository can manage the push policy for the repository.
|
||||
topics:
|
||||
- Repositories
|
||||
shortTitle: Manage the push policy
|
||||
---
|
||||
|
||||
## About the push policy
|
||||
|
||||
{% note %}
|
||||
|
||||
**Note:** The push policy is currently in beta and subject to change.
|
||||
|
||||
{% endnote %}
|
||||
|
||||
By default, there is no limit to the number of branches and tags that can be updated in a single push.
|
||||
|
||||
You can limit the number of branches and tags that can be updated in a single push to block potentially destructive pushes. This can prevent or limit the loss of data.
|
||||
|
||||
The push policy also blocks the Git command: `git push --mirror`. This is a potentially destructive command for making the remote exactly match the local clone. When run by accident, it can cause many force-pushes and branch deletions on the remote without any warning.
|
||||
|
||||
## Limiting how many branches and tags can be updated in a single push
|
||||
|
||||
{% data reusables.repositories.navigate-to-repo %}
|
||||
{% data reusables.repositories.sidebar-settings %}
|
||||
3. Under "Pushes", select **Limit how many branches and tags can be updated in a single push**.
|
||||
|
||||

|
||||
4. Enter the number of branches and tags you want to limit in a single push. Lower numbers are more restrictive of which pushes are allowed, and higher numbers are less restrictive but have more potential for being destructive.
|
||||
|
||||
We recommend the default maximum of `5` branch or tag updates allowed in one push. The minimum value is `2`, because Git requires two branch updates to rename a branch in a single push: *delete branch* and *create branch*.
|
||||
|
||||

|
||||
7
data/features/limit-branches-tags-in-push.yml
Normal file
7
data/features/limit-branches-tags-in-push.yml
Normal file
@@ -0,0 +1,7 @@
|
||||
# Reference: #6046
|
||||
# Repo Policies: Admins can block pushes that destructively use --mirror - [GA]
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghec: '*'
|
||||
ghes: '>=3.7'
|
||||
ghae: '>=3.7'
|
||||
Reference in New Issue
Block a user