Re: diff <commit> using 3-dot behavior
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 24, 2016, 16:22 UTC
- Message-ID
- <xmqqbn0irvan.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <CAHd499DL2WiTgnk5A--qihUh-jF9m7aXDzHAQuW=bLRVW4Bniw@mail.gmail.com>
Robert Dailey <rcdailey.lists@gmail.com> writes:
> $ git diff master...topic
... which is defined roughly as
git diff $(git merge-base master topic) topic
The merge-base is to compute the point you forked your topic from the mainline. So if you want to compare your current state in the index with the fork point, you'd do
git diff --cached $(git merge-base master topic)
and comparing your working tree state would be
git diff --cached $(git merge-base master topic)