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

Re: [PATCH] Clarification for the command "git checkout <branch>"

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 1, 2010, 04:52 UTC
Message-ID
<7vd3yjsriz.fsf@alter.siamese.dyndns.org>
In-Reply-To
<p2nf3271551003302058ve6b54731h1bea42b5c6605928@mail.gmail.com>
Ramkumar Ramachandra <artagnon@gmail.com> writes:
Show 6 quoted lines
> On Wed, Mar 31, 2010 at 3:43 AM, Junio C Hamano <gitster@pobox.com> wrote:
>> +such a case, you may want retry the command after recording the local
>> +changes (1) in a temporary commit on the current branch, or (2) by using
>> +"git stash". Alternatively, use "-m" option to force a merge.
>
> Couple of things: Is (1) really an option?

Of course; otherwise I wouldn't have written it, but another option (0) would be:

    (0) if you are in the middle of working something for the current
    branch, finish it first before switching to other task.
But that would go without saying.
> The user will have to go
> through documentation on rewriting history, which I find completely
> unnecessary to just switch branches.

I think you are thinking backwards. If the user always does a perfect job before making each and every commit, she doesn't ever need to learn "amend". Otherwise, she will learn "amend" way before learning to switch between branches to work on different things at the same time.

IOW, by the time the user learns branch switching, I expect she at least knows about "amend" (if not rebase-i/filter-branch), and that is all that is necessary to restart from a WIP commit when she comes back.

Previous: Ramkumar RamachandraNext: Ramkumar Ramachandra
Message 52 of 56 in “Better cooperation between checkouts and stashing”
  1. Markus ElfringFeb 1, 2010
  2. Junio C HamanoFeb 1, 2010
  3. Markus ElfringFeb 1, 2010
  4. Eugene SajineFeb 1, 2010
  5. Petr BaudisFeb 2, 2010
  6. Markus ElfringFeb 2, 2010
  7. Petr BaudisFeb 2, 2010
  8. Markus ElfringFeb 9, 2010
  9. Junio C HamanoFeb 9, 2010
  10. Markus ElfringFeb 9, 2010
  11. Markus ElfringFeb 18, 2010
  12. Junio C HamanoFeb 18, 2010
  13. Markus ElfringFeb 27, 2010
  14. Junio C HamanoFeb 27, 2010
  15. Markus ElfringFeb 28, 2010
  16. Michael WittenFeb 28, 2010
  17. Markus ElfringMar 1, 2010
  18. Michael WittenMar 1, 2010
  19. Junio C HamanoMar 1, 2010
  20. Michael WittenMar 1, 2010
  21. Markus ElfringMar 1, 2010
  22. Junio C HamanoMar 1, 2010
  23. Markus ElfringMar 1, 2010
  24. Michael WittenMar 2, 2010
  25. Markus ElfringMar 2, 2010
  26. Junio C HamanoMar 2, 2010
  27. Markus ElfringMar 3, 2010
  28. Michael WittenMar 4, 2010
  29. Markus ElfringMar 4, 2010
  30. Markus ElfringMar 2, 2010
  31. Junio C HamanoMar 2, 2010
  32. Markus ElfringMar 3, 2010
  33. Markus ElfringMar 17, 2010
  34. Avery PennarunMar 17, 2010
  35. Markus ElfringMar 17, 2010
  36. Junio C HamanoMar 17, 2010
  37. Markus ElfringMar 17, 2010
  38. Junio C HamanoMar 17, 2010
  39. Michael WittenMar 17, 2010
  40. Junio C HamanoMar 17, 2010
  41. Markus ElfringMar 18, 2010
  42. Avery PennarunMar 18, 2010
  43. Michael WittenMar 18, 2010
  44. Avery PennarunMar 18, 2010
  45. Markus ElfringMar 19, 2010
  46. Avery PennarunMar 19, 2010
  47. Markus ElfringMar 20, 2010
  48. Markus ElfringMar 19, 2010
  49. Markus ElfringMar 30, 2010
  50. Junio C HamanoMar 30, 2010
  51. Ramkumar RamachandraMar 31, 2010
  52. Junio C HamanoApr 1, 2010
  53. Ramkumar RamachandraApr 1, 2010
  54. Markus ElfringApr 1, 2010
  55. Markus ElfringApr 10, 2010
  56. Junio C HamanoApr 10, 2010

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.