GitHub has several options for merging a Pull Request. One is to Squash and merge
. When this option is chosen, all intermediate commits are squashed before merging. The odd thing is that in the network graph (insights tab), the branch (from which the Pull Request was created) does not appear to merge into master. You see the same thing if you use Sourcetree.
Instead of selecting, Squash and merge
if you choose to the Merge pull request
option, you see the branch merging with master.
Why does this happen? I would've expected the branch to merge with master after squashing intermediate commits in the Squash and merge
operation as well.
On GitHub.com, navigate to the main page of the repository. Under your repository name, click Settings. Under "Pull Requests", select Allow squash merging. This allows contributors to merge a pull request by squashing all commits into a single commit.
3 Answers. Show activity on this post. In my opinion, and bear in mind, this is just an opinion, and you will likely get different answers, you should NOT squash the commits when merging into master from the develop branch. Doing so would lose a lot of the history of the changes that have been made.
Squash merging is a merge option that allows you to condense the Git history of topic branches when you complete a pull request. Instead of each commit on the topic branch being added to the history of the default branch, a squash merge adds all the file changes to a single new commit on the default branch.
The graphical tools that are drawing the merge arrow are looking for a 'merge commit'. Using the 'squash and merge' option on Github does not create a merge commit (it is 'squashed').
More information about the different merge methods on GitHub: https://help.github.com/articles/about-merge-methods-on-github/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With