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

Re: Switching branches without committing changes

From
JFJoe Fiorini <joe@faithfulgeek.org>
Date
Mar 21, 2008, 04:40 UTC
Message-ID
<0A5FD247-A09E-4E3A-8BB5-35F9390E7FB3@faithfulgeek.org>
In-Reply-To
<20080321041013.GA2502@coredump.intra.peff.net>

Thanks for the replies. I definitely like the stashing approach. Is there any overhead or caveat to using stash a lot?

-Joe
On Mar 21, 2008, at 12:10 AM, Jeff King wrote:
Show 16 quoted lines
> On Fri, Mar 21, 2008 at 12:06:47AM -0400, Shawn O. Pearce wrote:
>
>> Use `git checkout -m` to switch the branch anyway.  However, if
>> there is a merge conflict while you are trying to carry the changes
>> to the other branch you may be faced with a merge conflict you are
>> not prepared to resolve, or simply cannot resolve in a reasonable
>> period of time.
>
> Ah, for some reason I didn't think of '-m' in the advice I gave (I  
> guess
> I have just never used it). It is almost certainly simpler than  
> using a
> 'stash' at this point (but I do think stashing _beforehand_ still has
> advantages).
>
> -Peff
Previous: Jeff KingNext: Junio C Hamano
Message 5 of 10 in “Switching branches without committing changes”
  1. Joe FioriniMar 21, 2008
  2. Jeff KingMar 21, 2008
  3. Shawn O. PearceMar 21, 2008
  4. Jeff KingMar 21, 2008
  5. Joe FioriniMar 21, 2008
  6. Junio C HamanoMar 21, 2008
  7. Joe FioriniMar 21, 2008
  8. Xavier MaillardMar 23, 2008
  9. Joe FioriniMar 24, 2008
  10. Jeff KingMar 24, 2008

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.