Default merge strategy (per org, repo or branch) #20583
Replies: 127 comments 21 replies
-
Make totally sense, +1 for such improvement |
Beta Was this translation helpful? Give feedback.
-
It would also be interesting to have the option for users to define a default strategy. For example, if I work in multiple organisations and Org A defines "Fast Forward" as a default and Org B defines no default, if I set my default to "Squash" merging a PR in Org A would use "Fast Forward" as the strategy whereas merging a PR in Org B would use "Squash". |
Beta Was this translation helpful? Give feedback.
-
A default strategy per branch is a good improvement, but I'd rather completely disable certain strategies with certain branches. |
Beta Was this translation helpful? Give feedback.
-
It's pretty annoying to not be able to have different merge strategies per branch. We have repos where we use a strategy of merging PRs into a develop branch, and to release we merge develop into main. We want to enforce squash merge from PRs into develop, but never squash merge from develop to main because then git gets very confused about what has already been merged. |
Beta Was this translation helpful? Give feedback.
-
+1 I need to define allowed and default merge method individually for some named branches. |
Beta Was this translation helpful? Give feedback.
-
+1 - Very useful for open-source projects with multiple repos |
Beta Was this translation helpful? Give feedback.
-
+1 - very useful for project with env specific branches |
Beta Was this translation helpful? Give feedback.
-
+1 This would be very helpful to companies using different merging for lower environments than those used in the upper envs. |
Beta Was this translation helpful? Give feedback.
-
+1. This is absolutely necessary. If I have master, release and develop. Then I only want to allow squash merge into develop (I usually like 1 commit per change rather than 50 or more, which gets messy imo). Rest needs to be regular commit. Otherwise the github compare mechanisms starting thinking there are missing commits and it does not work well. |
Beta Was this translation helpful? Give feedback.
-
other relevant issue that is very similar to this one 👉 https://github.com/orgs/community/discussions/10809 |
Beta Was this translation helpful? Give feedback.
-
Hi @Snailedlt, Great point! Setting a default merge strategy for organizations or repositories would significantly improve workflow and minimize errors. Here are a few key suggestions: Repository Settings: Allow admins to set a default merge strategy. Highlighting the default in the merge dropdown (perhaps with color or an emoji) would provide clear guidance to users. These changes could streamline merges and enhance the GitHub experience! |
Beta Was this translation helpful? Give feedback.
-
Two years without answer... +1 |
Beta Was this translation helpful? Give feedback.
-
+1 I think it would be pretty simple to implement since UI already has |
Beta Was this translation helpful? Give feedback.
-
Please papa microsoft, before Lina Khan busts your monopoly |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Default Merge Strategy
Why we need it
In our GitHub organization we have a workflow where the preferred merge strategy is
Squash and merge
. Whenever we merge into master, we usually use this strategy. We would like to be able to set this as the default merge strategy, without removing the options forCreate a merge commit
andRebase and merge
for special occasions. Currently the only way to setSquash and merge
is to disable the other options. This is problematic, since we sometimes need to merge using other merge strategies in special cases, for example if the PR closes multiple issues, and we want one commit per issue it solves. Another thing that makes this hard is that currently GitHub selects the merge strategy based on what you selected ln your last PR. This means that when an unusual option is selected, the user needs to remember to change it back to the "default" so that he/she doesn't accidentally merge with the wrong strategy on their next merge. This is a big source of user errors, and can lead to multiple hours spent trying to fix the (sometimes irreversible) mistakes done by choosing the wrong merge strategy. Instead of having the default be the last selected strategy, it should be possible for repository admins to select which merge strategy is defaulted to.Suggested Implementations
Additionally, if the GitHub UX team finds it useful, it would be nice to have the default merge strategy highlighted in the merge button dropdown. Either with a different background color, or an associated emoji to show if the merge strategy is a default in the org, repo or branch.
Implementations and other relevant links
Relevant Links
Implementations by GitHub alternatives
Bitbucket Cloud (My favourite)
Bitbucket Server
Gitlab
Gitea
Beta Was this translation helpful? Give feedback.
All reactions