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

Re: [PATCH v2 0/5] root refs vs pseudorefs

From
Julia Evans <julia@jvns.ca>
Date
Nov 3, 2026, 14:36 UTC
Message-ID
<d3878168-95b9-4b4b-bfd8-85d459122e5f@app.fastmail.com>
In-Reply-To
<CAHWeT-YSK3xFA=Hztr3Uj5UW=L9JcC_0iOa5pUG-WGCpwng9vw@mail.gmail.com>
Show 12 quoted lines
> pseudoref
>     A name that can be used like a ref to refer to an object, but that
>     is not stored in the same way as refs. For example, pseudorefs can
>     be passed to git-log(1) or git-diff(1), but they cannot be written
>     by git-update-ref(1) or listed by git-for-each-ref(1).
>
>     The following pseudorefs are known to Git:
>
>     •   FETCH_HEAD is written by git-fetch(1) or git-pull(1). It may
>         refer to multiple object IDs. Each object ID is annotated with
>         metadata indicating where it was fetched from and its fetch
>         status.

I found "Each object ID is annotated with metadata indicating where it was fetched from and its fetch status." to be very hard to parse, and I had to go look at .git/FETCH_HEAD myself to understand what it was talking about.

It might help to instead describe `FETCH_HEAD` with an example, especially since we already aren't giving a lot of details. Maybe something like this:

  Git has 2 special pseudorefs: `MERGE_HEAD` and `FETCH_HEAD`.
  Unlike references (which can only contain an object ID or the name of
  another reference), these have their own format:
  
  - `FETCH_HEAD` has a list of entries like this:
    `d4c5f27105ee2e44366d718dbc5db95bbe99c714 not-for-merge branch 'example' of https://example.com/x/y`
    with details about what was fetched by linkgit:git-fetch[1].
  - `MERGE_HEAD` has a list of commit IDs
  
  These are stored as files in the `.git` directory. You can pass a pseudoref
  to `git show`, `git log`, etc, and it will use the first ID in the list. 
  Pseudorefs can't be written by git-update-ref(1) or listed by
  git-for-each-ref(1).
Previous: Andy KoppeNext: Junio C Hamano
Message 24 of 34 in “root refs vs pseudorefs”
  1. 0/5 root refs vs pseudorefsAndy Koppe, Oct 22, 2026
  2. 1/5 doc: glossary: add root ref and clarify pseudorefsAndy Koppe, Oct 22, 2026
  3. Junio C HamanoOct 22, 2026
  4. Patrick SteinhardtOct 23, 2026
  5. Andy KoppeNov 1, 2026
  6. 2/5 doc: glossary: update per-worktree refsAndy Koppe, Oct 22, 2026
  7. Patrick SteinhardtOct 23, 2026
  8. Andy KoppeNov 1, 2026
  9. 3/5 doc: stop calling root refs pseudorefsAndy Koppe, Oct 22, 2026
  10. Patrick SteinhardtOct 23, 2026
  11. Andy KoppeNov 1, 2026
  12. 4/5 refs: stop calling root refs pseudorefsAndy Koppe, Oct 22, 2026
  13. Patrick SteinhardtOct 23, 2026
  14. Andy KoppeNov 1, 2026
  15. 5/5 t: stop calling root refs pseudorefsAndy Koppe, Oct 22, 2026
  16. Junio C HamanoOct 22, 2026
  17. Julia EvansOct 23, 2026
  18. Andy KoppeNov 1, 2026
  19. 0/5 root refs vs pseudorefsAndy Koppe, Nov 1, 2026
  20. Julia EvansNov 2, 2026
  21. Andy KoppeNov 2, 2026
  22. Julia EvansNov 2, 2026
  23. Andy KoppeNov 2, 2026
  24. Julia EvansNov 3, 2026
  25. Junio C HamanoNov 2, 2026
  26. 1/5 doc: glossary: add root ref and clarify pseudorefsAndy Koppe, Nov 1, 2026
  27. Patrick SteinhardtNov 3, 2026
  28. Junio C HamanoNov 3, 2026
  29. 2/5 doc: glossary: update per-worktree refsAndy Koppe, Nov 1, 2026
  30. Patrick SteinhardtNov 3, 2026
  31. 3/5 doc: stop calling root refs pseudorefsAndy Koppe, Nov 1, 2026
  32. Patrick SteinhardtNov 3, 2026
  33. 4/5 refs: stop calling root refs pseudorefsAndy Koppe, Nov 1, 2026
  34. 5/5 t: stop calling root refs pseudorefsAndy Koppe, Nov 1, 2026

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.