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

Re: Why does git stash create two commits?

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 30, 2012, 19:11 UTC
Message-ID
<7vhazdatur.fsf@alter.siamese.dyndns.org>
In-Reply-To
<4F26DF7B.7050109@ubuntu.com>
Phillip Susi <psusi@ubuntu.com> writes:
> git stash makes two commits, one that has no changes from the base,
> and one to stash your changes in.  Why?

The only reason the former is identical to the base is because you are not incrementally building your next commit using "git add". It represents the state of your index. The latter represents the state of the tracked files in your working tree.

Previous: Seth Robertson
Message 3 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.