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

Re: [PATCH] Add git-stash to stash the working tree to a new tagged name

From
Junio C Hamano <junkio@cox.net>
Date
Apr 24, 2006, 20:54 UTC
Message-ID
<7vfyk27kz4.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<8764kyzrwq.wl%cworth@cworth.org>
Carl Worth <cworth@cworth.org> writes:
Show 9 quoted lines
> Stashing (on branch 'feature'):
>
> 	git commit -a -m 'snapshot WIP'
>
> Recovering:
>
> 	git checkout feature
> 	git reset --soft HEAD^
> 	git reset
If I were doing this today, I would probably do this:
	git commit -a -m 'WIP'
        git checkout elsewhere ;# interrupted
        ... hack hack hack ...
        git checkout feature ;# come back
        ... hack hack hack ...
        git commit --amend

But I wonder why the originally suggested sequence is reset soft to the state we want and then another reset. Without experimenting myself or thinking hard about it, I would expect "git reset HEAD^" should do what we want, in which case:

Stashing (on branch 'feature'):
	git commit -a -m 'snapshot WIP'
Recovering:
	git checkout feature
	git reset HEAD^
Previous: Carl WorthNext: Carl Worth
Message 2 of 3 in “Add git-stash to stash the working tree to a new tagged name”
  1. Add git-stash to stash the working tree to a new tagged nameCarl Worth, Apr 24, 2006
  2. Junio C HamanoApr 24, 2006
  3. Carl WorthApr 24, 2006

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.