Reputation: 2114
On Github every time I merge a pull request into my base branch I get an extra merge commit:
Merge pull request #77 ...
I prefer to get a git history without these merge commits.
How can I achieve that?
Upvotes: 34
Views: 25382
Reputation: 45819
Here are your options:
A squash will result in a single new commit representing all changes at the head of the main branch. It is a special case of rebase.
A rebase will result in one or more new commits (any or all of which may be in a "broken"/unbuildable state) at the head of the main branch.
A merge creates a merge commit and leaves history as it really happened.
Here is documentation of the options: https://github.com/blog/2243-rebase-and-merge-pull-requests
Upvotes: 12
Reputation: 2114
To get a git history without any pull request merge commits I can use the merge button (Pull request page) and perform a rebase and merge:
Upvotes: 29