From: Junio C Hamano Date: Thu, 01 Apr 2010 04:52:52 GMT Subject: Re: [PATCH] Clarification for the command "git checkout " Message-ID: <7vd3yjsriz.fsf@alter.siamese.dyndns.org> In-Reply-To: Ramkumar Ramachandra writes: > On Wed, Mar 31, 2010 at 3:43 AM, Junio C Hamano 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.