git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Why is reflog so obscure?

From
Sergey Organov <sorganov@gmail.com>
Date
Jul 12, 2022, 15:18 UTC
Message-ID
<87ilo2we9o.fsf@osv.gnss.ru>
In-Reply-To
<xmqqo7xuif46.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
Show 23 quoted lines
> Thomas Guyot <tguyot@gmail.com> writes:
>
>> Thanks for clarifying that - I suspected it since we can do
>> <branch>@{<date>} although I didn't find any reference branch reflogs
>> in the documentation. I could've missed it... Is there a way to read a 
>> branch reflog?
>
>     $ git reflog ;# lists entries of reflog of HEAD, starting at HEAD@{0}
>     $ git reflog HEAD ;# same
>     $ git reflog HEAD@{4} ;# same, starting at HEAD@{4}
>     $ git reflog master ;# entries of reflog of "master"
>     $ git reflog master@{0} ;# same
>     $ git reflog master@{now} ;# same, show with timestamps
>     $ git reflog master@{4.minutes} ;# same, starting at master@{4.minutes}
>
> For the branch that is currently checked out, you can omit the name
> when you use any of the @{...} notation, so 
>
>     $ git reflog @{0}
>     $ git reflog @{now}
>
> are often the easiest ways to view what you did on the current
> branch.

Very handy, thanks! Would be nice to have this in EXAMPLES section of corresponding manual page.

Honestly, I tried (admittedly not very hard) to figure how to get dates from "git reflog" a few times, but every time I gave up, so this (along with the --dates option turning dates output on) is not very discoverable.

-- 
Sergey Organov
Previous: Junio C HamanoNext: Junio C Hamano
Message 6 of 8 in “Why is reflog so obscure?”
  1. Gerriko ioJul 11, 2022
  2. Thomas GuyotJul 11, 2022
  3. Jeff KingJul 12, 2022
  4. Thomas GuyotJul 12, 2022
  5. Junio C HamanoJul 12, 2022
  6. Sergey OrganovJul 12, 2022
  7. Junio C HamanoJul 12, 2022
  8. Thomas GuyotJul 14, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.