Switch merge strategy of Github pull requests to "squash and merge" #171
Replies: 4 comments 4 replies
-
Because of how the way github works with reviews and fixes I agree that squashing is better, it also allows git bisect to work better |
Beta Was this translation helpful? Give feedback.
-
I don't think squashing all the commits from a pr is a good idea. |
Beta Was this translation helpful? Give feedback.
-
I like the discussion and different points of view. Regarding what have been said already, I get the feeling that we should have a discussion on Git merge vs. rebase and how to handle branches, be it for feature development, bug fixes or long lived releases. So the whole picture of our branching and merging strategy. After this we could clarify for this "detail". |
Beta Was this translation helpful? Give feedback.
-
Closing this idea in favor of a broader Git branching and release strategy. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Currently we use the Github standard settings for merging pull requests like so:
The default is "Merge pull request" which merges all commits of the pull request into the target branch. One by one. This may pollute the Git history and make code changes non "atomical".
To have a tidy commit history the contributor is in charge to squash his commits into one and force push these onto his feature or bugfix branch. This is anything but a good workflow since:
I suggest the following:
That way we get a nice clean commit history and "atomical" changes in only one commit which is easy to track down.
Additionally, we should allow for "Always suggest updating pull request branches" so new changes to the base branch can be easily updated via the Github web UI.
For detailed information on this concrete topic: Git Rebase vs Git Merge: Never Force Push Again | Understandable
Some more information on Git rebase being bad: Git rebase, squash...oh my! - mgasch.com
@artist4artix @dec05eba @metux @mikedld @stefan11111 What do you think?
Beta Was this translation helpful? Give feedback.
All reactions