Re: How can I search git log with ceratin keyword but without the other keyword?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Jul 18, 2020 at 10:28 PM 孙世龙 sunshilong <sunshilong369@xxxxxxxxx> 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 first

Carlo

[1] https://git-scm.com/book/zh/v2/Git-%E5%B7%A5%E5%85%B7-%E9%80%89%E6%8B%A9%E4%BF%AE%E8%AE%A2%E7%89%88%E6%9C%AC




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux