4

I have the following scenario that was explained on the following link: GitHub Merge branch 'master'

I have accepted the fact that with github the action of "merge branch ..." is needed so that we understand that we took a pull request and merged it in.

However 896 commits later with several co-workers I have way too many: 'Merge branch 'master' of https://github.com/xxx/yyy' and Merge pull request #XXX

is there an effective way to collectively have the proper real commit and not just a bunch of Merge with X and Y, then Merge with Pull, etc etc. about 50% of the commits on master is full of it.

1 Answer 1

4

Make it a habit to do rebase pulls (i.e. merges) using:

$ git pull --rebase

This means that instead of having a merge scenario:

A---------M
 \       /
  B-----C

You'll have a simple rebase:

A--B----C

If all team members do this, it will significantly reduce the number of merge commits you see in the history.

Sign up to request clarification or add additional context in comments.

2 Comments

What happens if your the one that is doing it and your doing pull requests via github. When I click MERGE i get those "merge" branch already.
Ask your collaborators to rebase their feature branches (git checkout feature && git rebase master). If the pull request is a fast-forward merge (as is the case after rebasing), no merge commits are created.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.