3

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.

Community
  • 1
  • 1
azngunit81
  • 1,574
  • 2
  • 20
  • 38

1 Answers1

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.

Yuval Adam
  • 161,610
  • 92
  • 305
  • 395
  • 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. – azngunit81 Apr 18 '14 at 21:53
  • 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. – Yuval Adam Apr 18 '14 at 21:59