Proposal: Disable force push in repo settings #3278

Closed
opened 2025-11-02 05:06:23 -06:00 by GiteaMirror · 13 comments
Owner

Originally created by @kolaente on GitHub (May 1, 2019).

(Not sure if there is an issue about this exact thing already)

It would be cool if one could make a repo setting to disable force pushing for everyone, or just certain members. This would be in addition the current "branch protection settings".
Currently it is only possible to forbid pushing completely, I think it would be great if Gitea could only forbid force pushes while still allowing normal pushes.

Originally created by @kolaente on GitHub (May 1, 2019). (Not sure if there is an issue about this exact thing already) It would be cool if one could make a repo setting to disable force pushing for everyone, or just certain members. This would be in addition the current "branch protection settings". Currently it is only possible to forbid pushing completely, I think it would be great if Gitea could only forbid force pushes while still allowing normal pushes.
GiteaMirror added the type/proposaltype/enhancementissue/duplicate labels 2025-11-02 05:06:23 -06:00
Author
Owner

@lafriks commented on GitHub (May 1, 2019):

Currently it does disable force pushes for protected branches, there is imho even no way to allow them once branch is protected

@lafriks commented on GitHub (May 1, 2019): Currently it does disable force pushes for protected branches, there is imho even no way to allow them once branch is protected
Author
Owner

@lunny commented on GitHub (May 2, 2019):

@lafriks I think @kolaente means we could have an option to only disallow force push to some branches.

@lunny commented on GitHub (May 2, 2019): @lafriks I think @kolaente means we could have an option to only disallow force push to some branches.
Author
Owner

@lafriks commented on GitHub (May 2, 2019):

But if branch is protected in what configuration you can do force push currently?

@lafriks commented on GitHub (May 2, 2019): But if branch is protected in what configuration you can do force push currently?
Author
Owner

@kolaente commented on GitHub (May 2, 2019):

@lafriks If the branch is not protected, or the user is whitelisted to push. I want to be able to allow normal pushing, but prevent users from force pushing. Currently, if the branch is protected, the user is neither allowed to push normally.

@kolaente commented on GitHub (May 2, 2019): @lafriks If the branch is not protected, or the user is whitelisted to push. I want to be able to allow normal pushing, but prevent users from force pushing. Currently, if the branch is protected, the user is neither allowed to push normally.
Author
Owner

@lafriks commented on GitHub (May 5, 2019):

@kolaente but you can protect branch and whitelist team, this way users will be able to push but not force push

@lafriks commented on GitHub (May 5, 2019): @kolaente but you can protect branch and whitelist team, this way users will be able to push but not force push
Author
Owner

@jbeyerstedt commented on GitHub (May 8, 2019):

I think, this is the same problem I have with the branch protection settings.
The text at the "Enable branch protection" checkbox says:

Prevent deletion and disable Git force pushing to the branch.

This is would be, what I expect to happen, when the checkbox is activated. No-one will be able to delete this branch and force pushing will also not be possible. But the issue is, that any kind of pushing is disabled (which is not, what the text says).

Then there is the "Enable push whitelist" button, which has the explanation:

Allow whitelisted users or teams to bypass push restrictions.

This does not clearly say, if the whitelist will only be allowed to push normally, or also be allowed to force push.

So the behaviour, that you want to have an option to disable force pushing, but keep "normal" pushes, is possible (by protecting the branch, but adding the users to the whitelist, as @lafriks stated). So the the real issue is, that explanation texts do not say, what really will happen.
(It you think, this is a separate issue, I will open another one)

@jbeyerstedt commented on GitHub (May 8, 2019): I think, this is the same problem I have with the branch protection settings. The text at the "Enable branch protection" checkbox says: > Prevent deletion and disable Git force pushing to the branch. This is would be, what I expect to happen, when the checkbox is activated. No-one will be able to delete this branch and force pushing will also not be possible. But the issue is, that any kind of pushing is disabled (which is not, what the text says). Then there is the "Enable push whitelist" button, which has the explanation: > Allow whitelisted users or teams to bypass push restrictions. This does not clearly say, if the whitelist will only be allowed to push normally, or also be allowed to force push. So the behaviour, that you want to have an option to disable force pushing, but keep "normal" pushes, is possible (by protecting the branch, but adding the users to the whitelist, as @lafriks stated). So the the real issue is, that explanation texts do not say, what really will happen. (It you think, this is a separate issue, I will open another one)
Author
Owner

@lafriks commented on GitHub (May 8, 2019):

@jbeyerstedt descriptions definitely needs updating. Currently to my knowledge force pushes at disabled always. When no users is whitelisted puses are disabled completely except for PR merges

@lafriks commented on GitHub (May 8, 2019): @jbeyerstedt descriptions definitely needs updating. Currently to my knowledge force pushes at disabled always. When no users is whitelisted puses are disabled completely except for PR merges
Author
Owner

@jbeyerstedt commented on GitHub (May 8, 2019):

As far as I have tested it, this is correct. If branch protection is enabled, no force pushes are possible. "Normal" pushes can be (re-)enabled with the whitelist.
This behaviour is fine as it is, so the only issue are the descriptions. Therefore the issue label "kind/proposal" is not quite accurate, but it's more likely a bug. (I haven't found a better suiting label)

@jbeyerstedt commented on GitHub (May 8, 2019): As far as I have tested it, this is correct. If branch protection is enabled, no force pushes are possible. "Normal" pushes can be (re-)enabled with the whitelist. This behaviour is fine as it is, so the only issue are the descriptions. Therefore the issue label "kind/proposal" is not quite accurate, but it's more likely a bug. (I haven't found a better suiting label)
Author
Owner

@lunny commented on GitHub (May 9, 2019):

@jbeyerstedt I think this issue is about add a method to only disable deletion and force push. So that we don't need to set push whitelist(currently you have to set who can push normal commits). I think it's a new issue, it's not the same as what you are talking with @lafriks. So I think it's not a bug but an enhancement.

@lunny commented on GitHub (May 9, 2019): @jbeyerstedt I think this issue is about add a method to only disable deletion and force push. So that we don't need to set push whitelist(currently you have to set who can push normal commits). I think it's a new issue, it's not the same as what you are talking with @lafriks. So I think it's not a bug but an enhancement.
Author
Owner

@jbeyerstedt commented on GitHub (May 9, 2019):

If I look back at the issue title, you are right, that this issue requests an additional, more easily accessible option to disable force pushing for the whole repo (with white- and blacklist).

But reading the description of this issue, it was not clear to me, if this really was the request, or just the result of being not able to find the existing functionality. That's the reason, I asked and tried to get to the bottom of the question. (You know, sometimes you ask something, because you think, that this will get you further down the road, but your real issue is something different).

@jbeyerstedt commented on GitHub (May 9, 2019): If I look back at the issue title, you are right, that this issue requests an additional, more easily accessible option to disable force pushing for the whole repo (with white- and blacklist). But reading the description of this issue, it was not clear to me, if this really was the request, or just the result of being not able to find the existing functionality. That's the reason, I asked and tried to get to the bottom of the question. (You know, sometimes you ask something, because you think, that this will get you further down the road, but your real issue is something different).
Author
Owner

@davidsvantesson commented on GitHub (Sep 29, 2019):

I think this issue is somewhat similar to #8288 (but different parts of the branch protection settings). As I understand there is a wish to not have to enter a whitelist for pushing but everyone with write access would automatically be whitelisted.

@davidsvantesson commented on GitHub (Sep 29, 2019): I think this issue is somewhat similar to #8288 (but different parts of the branch protection settings). As I understand there is a wish to not have to enter a whitelist for pushing but everyone with write access would automatically be whitelisted.
Author
Owner

@davidsvantesson commented on GitHub (Oct 21, 2019):

Isn't this issue duplicate of #5731?

@davidsvantesson commented on GitHub (Oct 21, 2019): Isn't this issue duplicate of #5731?
Author
Owner

@lunny commented on GitHub (Nov 2, 2019):

Yeah

@lunny commented on GitHub (Nov 2, 2019): Yeah
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#3278