Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [RFC] New command: 'git snapshot'.

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:46:08

Jon Loeliger [off-list ref] writes:
On Tue, 2009-02-10 at 04:51 +0000, Sitaram Chamarty wrote:
quoted
I use cross-branch stashes all the time.  Stash it here, go
there, and pop the stash.  I hope that does not change :-)
Perhaps 'git checkout -m other_branch'?
Sure, or even "git checkout other_branch" without -m.

"Stash it here, go there, and pop the stash" is what you would use when
you have many changes that you _know_ "checkout -m" will run a 3-way merge
to produce a heavy conflict, and you suspect you may need to be able to
retry the unstashing after taking a break.

If you are lucky and manage to resolve the conflicts easily (or did not
even get conflicts when applying), then pop will drop the stash and you
have everything you want in your index and the work tree.  Otherwise, your
work tree would be a mess, and you may have to "reset --hard" out to start
from scratch, but then the stash will still be there.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help