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

Switching branches without committing changes

From
JFJoe Fiorini <joe@faithfulgeek.org>
Date
Mar 21, 2008, 03:27 UTC
Message-ID
<A17C3E8C-3D0E-41B4-8A43-37EC8C3F55C2@faithfulgeek.org>
He all,

I'm still a newbie to Git (and this list), so if I don't provide enough details please let me know what you need and I will provide :).

I'm trying to switch branches without committing my changes. Is this possible? For example, I'm working on a site, I'm testing the implementation of a new technology (branch B), I'm not quite done there (or I forget to commit everything) and I want to implement something else new. I create a new branch off of B, called B.1, and then make some changes. I commit only the changes that apply to B.1 and then try to go back to B. However, I get an error saying a file I changed in B is not uptodate and it cannot merge. What am I doing wrong and how can I get back to B?

Thanks all! Joe

Next: Jeff King
Message 1 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.