-
Notifications
You must be signed in to change notification settings - Fork 28.7k
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
Warn before committing to protected branches #141867
Comments
Related to 62665 I've been burned by this before, and have just been burned by it again now, so I went looking to see if this has been reported before and found this issue. In today's case it was extremely fortunate that we had good knowledge of the changes, but this has potential to be extremely annoying/catastrophic. Looking at the history it seems that it ignores the protected branch that's on @github and uses some kind of forceful pushing mechanism to write to the main/master/trunk branch. Wondering if this could be changed as a short term fix to not be forceful and then a more eloquent solution, like the suggestion in the issue description or creating an array of protected branches in the settings or something. |
Adding an array of branches names that should be protected to the workspace settings is a great idea. Still, I would like to see a message that will allow me to create new branch instantly, skip the warning temporary, or disable the protection for this workspace or globally. I agree that it should be balanced. It can be very annoying in some cases, like personal small projects that you want to commit the main branch directly, but to be protected when the repository defines protected branches. |
The latest Stable release, contains two new settings that enable you to define a set of branch protections, and tweak the behaviour when one attempts to commit to a protected branch. Please take a look and let me know your feedback. This milestone, we are also adding visual indicators into the status bar, and branch picker to indicate branches that are protected. |
Closing as duplicate of #148783. |
Thanks @lszomoru ! Any reason why the older request that got enough votes (this one, mine) closed as duplicate of newer feature request that didn't get enough votes yet? Why it was implement due to the new one and not this one? I'm asking to understand if something is wrong with my request |
@rhalaly, there was nothing wrong with the feature request that you have filed. Even though I labeled the issue when it was filed in January, I simply forgot about it when #148783 was created so I have used that to track the implementation. I only remembered about this issue couple of days ago when a new comment was posted to it. Hope that answers your concerns. |
Thanks @lszomoru! |
It can be helpful to warn before committing to commonly protected branches like
main
,master
,dev
,release
, etc.The warning can contain these actions "Create a new branch", "Commit anyway", and "Don't show me again for this repository".
The text was updated successfully, but these errors were encountered: