-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
about git push -f #5731
Comments
It's not quite clear what you're asking. Gitea has protected branches so only certain users can push to that branch. Are you talking about adding a git hook for push - as in an arbitrary script that will check a commit and ensure that it passes some test? OK, well obviously we can't produce a UI for that - it would mean allowing users to arbitrarily upload scripts that would be run on push. If you are the administrator and owner of the gitea server you should be able to edit the repository on the filesystem to add such a git hook - however remember that will be run during pushes so could lock the system. Another option is to use the Gitea webhook system - the push will be accepted and then a webhook will be called which could then checkout the pushed commits and do the tests - it could then comment back on a PR or automatically push on to the master. |
是的,限制强制推送,可以控制谁能强制推送... |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions. |
But when setting protected branch it will already be protected from forced push even if set that user are allowed to do push to that branch |
But it already works this way. If I specify branch protection and whitelist user who can push to that branch that user will be able to push new commits but won't be able to force push |
Could it be that the OP is asking for a repository setting? Ie: blanket denying of force-pushes |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions. |
How to allow someone could push but cannot force push then? |
There is already a database element for this; |
What seem to be wanted here (google translated from Chinese):
I don't see the point of enabling force pushing for everyone to a protected branch (that would be like not protecting the branch). So it does only make sense in combination of a whitelist. And I suppose it should be different whitelists for who can push normal and who can force push? What is the use case here? |
closing per lack of feedback |
Wishing to increase the authority to control compulsory push restrictions
The text was updated successfully, but these errors were encountered: