0

So here's our present situation. We have a 'dev' branch (which has changes that won't go into 'master'/production) and an 'X' feature branch that a couple of developers have been working on.

Throughout the span of dev on feature branch 'X', there were normal commits but then 'dev' was merged in several times (including all the other branch commits to 'dev') so that it could be deployed to our QA instance for testing.

Aside from checking commit messages for devs who have troubled themselves to indicate the ticket number they are working on, is there a way to determine which commits were made directly to 'X' feature branch as opposed to the commits that came along with the merges?

tdlm
  • 597
  • 3
  • 14

2 Answers2

2

Yes there is. git log origin/X ^origin/dev This will give you a log of origin/X with all of origin/dev's commits removed. You may want to also exclude commits prior to X forking from master as well...

And if you want to go even further you can try adding --first-parent (I'm told by others though this may or may not work based on other users following the same parentage rules) and --no-merges which will hide merge commits which you may or may not want.

Another handy tip is to use shortlog instead of log which will give you more of an abbreivated summary that can be handy for release notes, or communication of whats in a branch.

UpAndAdam
  • 4,515
  • 3
  • 28
  • 46
-1

Use git log with option:

--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.

kan
  • 28,279
  • 7
  • 71
  • 101