Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get rid of constant "merge branch" from github by git

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.

like image 298
azngunit81 Avatar asked Oct 27 '25 22:10

azngunit81


1 Answers

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.

like image 154
Yuval Adam Avatar answered Oct 29 '25 12:10

Yuval Adam



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!