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

About --staged ang --cached

From
Lucas Seiki Oshiro <lucasseikioshiro@gmail.com>
Date
Dec 9, 2025, 19:03 UTC
Message-ID
<FD2160CA-DD56-4BDE-92B4-0859C3BD2396@gmail.com>
Hi!

Even though the name "cache" is considered obsolete for a long time (for example, gitglossary calls it "obsolete" since 2005 [1]), there are some commands that still uses the flag --cached to operate on the index (e.g. git-rm, git-grep), while newer commands (e.g., git-restore, git-stash) use --staged. git-diff is special case where both flags exist and they are synonyms since [2].

Personally, I'm used to type `git diff --staged` instead of `--cached`, and my muscle memory often makes me type `git rm --staged` instead of `git rm --cached`.

Do you think that it would be relevant to add --staged to the other commands just like [2] did to git-diff? Perhaps this is just a personal issue, but I find it curious that those commands still have a flag named after an obsolete name while newer commands are using --staged.

Thanks!

[1] f1671ecbfa ([PATCH] Assorted changes to glossary, 2005-08-18) [2] 2baf1850ce (git-diff: Add --staged as a synonym for --cached., 2008-10-29)

Next: Junio C Hamano
Message 1 of 3 in “About --staged ang --cached”
  1. Lucas Seiki OshiroDec 9, 2025
  2. Junio C HamanoDec 9, 2025
  3. Jacob KellerDec 10, 2025

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.