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

From: Junio C Hamano <[email-masked]>
Date: Wed, 31 Mar 2010 21:52:52 -0700

Ramkumar Ramachandra <[email-masked]> writes:

> On Wed, Mar 31, 2010 at 3:43 AM, Junio C Hamano <[email-masked]> 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.