Re: How can I search git log with ceratin keyword but without the other keyword?
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 20, 2020, 17:50 UTC
- Message-ID
- <xmqqmu3u9itq.fsf@gitster.c.googlers.com>
- In-Reply-To
- <CAPUEspj3A-bCo+WqiGksuLkqm65HAPiOjrWaAyy7S8XSy_Ohiw@mail.gmail.com>
Carlo Arenas <carenas@gmail.com> writes:
Show 16 quoted lines
> On Sat, Jul 18, 2020 at 10:28 PM 孙世龙 sunshilong <sunshilong369@gmail.com> wrote:
>> Is there some method(or command provided by git) that could get the
>> comments of a certain commit (e.g: first, second,... nth)
>
> what you are looking for is described sometimes as "relative
> reference" [1], so for example if you want to refer to the commit
> before last (ex: second from the top, counting as 0 base) in a
> repository that looks like:
>
> $ git log --oneline
> b1824b2 (HEAD -> master) second
> 00d85f1 first
> 68757c9 initial
>
> $ git log --oneline -n 1 HEAD@{1}
> 00d85f1 firstYou meant HEAD~1, not the nth reflog entry (which does not have anything to do with the parenthood sequence between commits).