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

Re: Switching branches without committing changes

From
Jeff King <peff@peff.net>
Date
Mar 21, 2008, 04:10 UTC
Message-ID
<20080321041013.GA2502@coredump.intra.peff.net>
In-Reply-To
<20080321040647.GE8410@spearce.org>
On Fri, Mar 21, 2008 at 12:06:47AM -0400, Shawn O. Pearce wrote:
Show 5 quoted lines
> 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: Shawn O. PearceNext: Joe Fiorini
Message 4 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.