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

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

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 10, 2009, 20:31 UTC
Message-ID
<7v7i3ym3tr.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<1234295272.10335.26.camel@ld0161-tx32>
Jon Loeliger <jdl@freescale.com> writes:
Show 6 quoted lines
> On Tue, 2009-02-10 at 04:51 +0000, Sitaram Chamarty wrote:
>
>> 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.

Previous: Jon LoeligerNext: Sitaram Chamarty
Message 6 of 16 in “[RFC] New command: 'git snapshot'.”
  1. Fabio Augusto Dal CastelFeb 9, 2009
  2. Giuseppe BilottaFeb 9, 2009
  3. Brandon CaseyFeb 9, 2009
  4. Sitaram ChamartyFeb 10, 2009
  5. Jon LoeligerFeb 10, 2009
  6. Junio C HamanoFeb 10, 2009
  7. Sitaram ChamartyFeb 11, 2009
  8. Fabio Augusto Dal CastelFeb 10, 2009
  9. Jeff KingFeb 10, 2009
  10. Junio C HamanoFeb 10, 2009
  11. Jeff KingFeb 10, 2009
  12. Geoffrey LeeFeb 10, 2009
  13. Jeff KingFeb 11, 2009
  14. Matthieu MoyFeb 11, 2009
  15. Fabio Augusto Dal CastelFeb 11, 2009
  16. Fabio Augusto Dal CastelFeb 10, 2009

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.