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

Re: Why does git stash create two commits?

From
SRSeth Robertson <in-gitvger@baka.org>
Date
Jan 30, 2012, 18:25 UTC
Message-ID
<201201301825.q0UIPLni016760@no.baka.org>
In-Reply-To
<4F26DF7B.7050109@ubuntu.com>
In message <4F26DF7B.7050109@ubuntu.com>, Phillip Susi writes:
    git stash makes two commits, one that has no changes from the base,
    and one to stash your changes in.  Why?
git-stash can make up to three commits:

working directory (of files git knows about) index working directory (of files git does not know about)

The third commit only appears if you use --all or --include-untracked.

Most likely you do not use -u/-a and your index has not been touched yet, so you only see two commits, of which one is empty.

					-Seth Robertson
Previous: Phillip SusiNext: Junio C Hamano
Message 2 of 3 in “Why does git stash create two commits?”
  1. Phillip SusiJan 30, 2012
  2. Seth RobertsonJan 30, 2012
  3. Junio C HamanoJan 30, 2012

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.