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

suggestion for git stash

From
BHBruno Haible <bruno@clisp.org>
Date
Sep 30, 2007, 18:50 UTC
Message-ID
<200709302050.41273.bruno@clisp.org>
Hi,

"git stash" has the effect of losing the distinction between untracked changes and changes in the index.

To reproduce:
- Clone the gnulib repository or of any repository with at least 2 files.
- Make changes to two files, say, README and NEWS.
  $ git add README
- $ git status
  now reports:
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#       modified:   README
#
# Changed but not updated:
#   (use "git add <file>..." to update what will be committed)
#
#       modified:   NEWS
#
- $ git stash
- $ git stash apply
- $ git status
  now reports:
# On branch master
# Changed but not updated:
#   (use "git add <file>..." to update what will be committed)
#
#       modified:   NEWS
#       modified:   README
#
no changes added to commit (use "git add" and/or "git commit -a")

Could "git stash" be changed to memorize which changes were already scheduled for commit and which didn't?

Bruno
Next: Junio C Hamano
Message 1 of 6 in “suggestion for git stash”
  1. Bruno HaibleSep 30, 2007
  2. Junio C HamanoSep 30, 2007
  3. Matthieu MoySep 30, 2007
  4. Bruno HaibleSep 30, 2007
  5. Johannes SchindelinSep 30, 2007
  6. git stash: document apply's --index switchMiklos Vajna, Sep 30, 2007

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.