Ignore meaningless “Merge branch” commits in Git history?
Please take a look at the following Git history:
About every second commit is meaningless “Merge branch” noise. I know that you can (and should) avoid it by rebasing, but my question is more about dealing with the situation afterwards.
Is there a trick to ignore “Merge branch” commits without information?
It would be acceptable for me to clone the repository and locally rewrite its history, so it is easier to analyze its changes (without all the “Merge branch” noise).
3 Solutions collect form web for “Ignore meaningless “Merge branch” commits in Git history?”
You are looking for
git log --no-merges
BroiSatse’s nice “git log –no-merges” trick can also be applied in gitk:
- View -> Edit view -> Additional arguments to git log: “–no-merges”
The result looks like this:
to avoid having a lot of merges, it is better to pull using rebase:
git pull --rebase
see docs here