I am using Git for my project and trying to follow best practice:
git merge --squash
. This keeps my dev branch clean.This should keep our history, and using gitk, we can see where all of the commits come in. However, I want to be able to see only the commits applied to the master branch. I have tried:
git log master
git show-branch
None of these show just the history of the master branch. Is there a way to easily do this?
If I'm understanding you correctly, you want to see the merges back into master, but not the history of those merges. I believe that:
git log --merges
will give you what you want.
UPDATE: Adding --first-parent should fix this from the sounds of it.
git log --merges --first-parent
--first-parent
Follow only the first parent commit upon seeing a merge commit.
This option can give a better overview when viewing the evolution of a particular topic branch, because merges into a topic branch tend to be only about adjusting to updated upstream from time to time, and this option allows you to ignore the individual commits brought in to your history by such a merge.