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

Minor typos in the documentation for git checkout <branch>

From
RORory O’Kane <rory@roryokane.com>
Date
Jan 17, 2019, 00:17 UTC
Message-ID
<CAD_ag1MODHkfkMyaovg2JgcsX-=Tk6+BHFSYxwE8g5HGhvZ-1g@mail.gmail.com>

I noticed some errors in one paragraph of the documentation for the <branch> argument of git-checkout. A convenient link to that documentation: https://git-scm.com/docs/git-checkout#git-checkout-ltbranchgt

This is the current AsciiDoc source for that paragraph:
    You can use the `"@{-N}"` syntax to refer to the N-th last
    branch/commit checked out using "git checkout" operation. You may
    also specify `-` which is synonymous to `"@{-1}`.

That source comes from Documentation/git-checkout.txt: https://github.com/git/git/blob/77556354bb7ac50450e3b28999e3576969869068/Documentation/git-checkout.txt#L290-L292

I suggest changing that source to this:
    You can use the `"@{-<n>}"` syntax to refer to the <n>th last
    branch/commit checked out using the "git checkout" operation. You
    may also specify `"-"`, which is synonymous to `"@{-1}"`.
These are the changes:
- Added the missing closing double quote to `"@{-1}` at the end.
- Added the word “the” before ‘"git checkout” operation’.
- Added quotes around “-”, to make it more visible and consistent with the
  other syntax in the paragraph.
- Added comma before “which”.
- For consistency, used the angle bracket style of placeholder also used by
  the explanation of the “@{-<n>}, e.g. @{-1}” syntax (see link) within the
  documentation for gitrevisions (see link).
  [gitrevisions source]:
https://github.com/git/git/blob/77556354bb7ac50450e3b28999e3576969869068/Documentation/revisions.txt#L94-L96
  [gitrevisions rendered]:
https://git-scm.com/docs/gitrevisions#gitrevisions-em-ltngtemegem-1em
(This is my first email to the Git mailing list; I hope I did it right.)
Message 1 of 1 in “Minor typos in the documentation for git checkout <branch>”
  1. Rory O’KaneJan 17, 2019

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.