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

Re: Switching branches without committing changes

From
XMXavier Maillard <xma@gnu.org>
Date
Mar 23, 2008, 01:00 UTC
Message-ID
<200803230100.m2N102oR025238@localhost.localdomain>
In-Reply-To
<7vod98u1pr.fsf@gitster.siamese.dyndns.org>
   Jeff King <peff@peff.net> writes:
   > 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).
   The thing is, that -m is really to mollify people who are _too_ accustomed
   to CVS/SVN update behaviour.  Over there, "scm update" does not give you
   any choice other than having to merge.
This post is *yet* another valuable candidate to put onto the wiki.
	Xavier
-- 
http://www.gnu.org
http://www.april.org
http://www.lolica.org
Previous: Joe FioriniNext: Joe Fiorini
Message 8 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.