Π·Π΅ΡΠΊΠ°Π»ΠΎ ΠΈΠ· https://github.com/github/docs.git
[2022-08-mid]: π Repo Policies: Admins can block pushes that destructively use --mirror - [GA] (#30141)
Co-authored-by: github-actions <github-actions@github.com> Co-authored-by: Lucas Costi <lucascosti@users.noreply.github.com> Co-authored-by: Matt Pollard <mattpollard@users.noreply.github.com>
This commit is contained in:
Π ΠΎΠ΄ΠΈΡΠ΅Π»Ρ
62c44b069f
ΠΠΎΠΌΠΌΠΈΡ
62072bea79
ΠΠ²ΠΎΠΈΡΠ½ΡΠ΅ Π΄Π°Π½Π½ΡΠ΅
assets/images/help/repository/limit-branches-and-tags-single-push.png
Normal file
ΠΠ²ΠΎΠΈΡΠ½ΡΠ΅ Π΄Π°Π½Π½ΡΠ΅
assets/images/help/repository/limit-branches-and-tags-single-push.png
Normal file
ΠΠ²ΠΎΠΈΡΠ½ΡΠΉ ΡΠ°ΠΉΠ» Π½Π΅ ΠΎΡΠΎΠ±ΡΠ°ΠΆΠ°Π΅ΡΡΡ.
ΠΠΎΡΠ»Π΅ Π¨ΠΈΡΠΈΠ½Π°: | ΠΡΡΠΎΡΠ°: | Π Π°Π·ΠΌΠ΅Ρ: 36 KiB |
ΠΠ²ΠΎΠΈΡΠ½ΡΠ΅ Π΄Π°Π½Π½ΡΠ΅
assets/images/help/repository/set-limit-branch-tags-single-push.png
Normal file
ΠΠ²ΠΎΠΈΡΠ½ΡΠ΅ Π΄Π°Π½Π½ΡΠ΅
assets/images/help/repository/set-limit-branch-tags-single-push.png
Normal file
ΠΠ²ΠΎΠΈΡΠ½ΡΠΉ ΡΠ°ΠΉΠ» Π½Π΅ ΠΎΡΠΎΠ±ΡΠ°ΠΆΠ°Π΅ΡΡΡ.
ΠΠΎΡΠ»Π΅ Π¨ΠΈΡΠΈΠ½Π°: | ΠΡΡΠΎΡΠ°: | Π Π°Π·ΠΌΠ΅Ρ: 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**.
|
||||
|
||||
![Screenshot of the limit how many branches and tags can be updated in a single push option](/assets/images/help/repository/limit-branches-and-tags-single-push.png)
|
||||
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*.
|
||||
|
||||
![Screenshot of the field where you enter the number of branches and tags you want to limit](/assets/images/help/repository/set-limit-branch-tags-single-push.png)
|
|
@ -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'
|
ΠΠ°Π³ΡΡΠ·ΠΊΠ°β¦
Π‘ΡΡΠ»ΠΊΠ° Π² Π½ΠΎΠ²ΠΎΠΉ Π·Π°Π΄Π°ΡΠ΅