Robber Pen
Robber Pen

Reputation: 1103

GIT - how to show git log only commit at branch

A-->B-->C-->D-->E  (master)
    \->X-->Y-/-->Z (debug)

Hi all if try

    git log master..debug

then I get Z only, because X, Y were merged to master branch. briefly, i wanna get all log/commit where committed at debug branch

Upvotes: 0

Views: 324

Answers (4)

Mike Monkiewicz
Mike Monkiewicz

Reputation: 4709

So to be clear, you want all the commits on the debug branch, since it originally diverged from master? B is the parent of the debug branch, so try,

git log B..debug

Upvotes: 0

Sebastian Bartos
Sebastian Bartos

Reputation: 2497

You can do this by specifying the range.

Let's say hash for X is abcd123 and Y is dcba321.

You can call:

git log abcd..dcba

This will show you the range. You you can truncate the hash, as long as it stays unique (e.g. use the first few chars).

Upvotes: 0

robinst
robinst

Reputation: 31427

Use the .. notation, e.g. like this:

git log master..feature

This lists all commits that are reachable from feature and excludes commits which are reachable from master. In other words, it lists commits that are "only" on feature.

Upvotes: 1

samuil
samuil

Reputation: 5081

git log parent_branch..new_branch

Upvotes: 0

Related Questions