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

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

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

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:24

Carl Worth [off-list ref] writes:
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^

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

From: Carl Worth <hidden>
Date: 2016-06-15 22:42:24

On Mon, 24 Apr 2006 13:54:39 -0700, Junio C Hamano wrote:
If I were doing this today, I would probably do this:
...
        git commit --amend
Oh, that's fantastic.

I hadn't picked up on this feature before, and it looks quite
useful. Thanks for pointing that out.

-Carl
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help