From: Nguyen Thai Ngoc Duy Date: Fri, 05 Nov 2010 08:41:52 GMT Subject: Re: Problems switching branches Message-ID: In-Reply-To: <4CD3A5D9.6070802@seznam.cz> On Fri, Nov 5, 2010 at 1:36 PM, Maaartin-1 wrote: >> But your approach may be better. Yes, I think it's possible. Any >> suggestion for checkout's new argument? --no-overwrite-untracked seems >> too long. > > I would go even further: a switch called "ignorant" or "lenient" > allowing to always switch branches in a non-destructible way. All files > normally causing abort would be left unmodified, so you could do > git checkout --ignorant forth; git checkout back > and would (assuming you started in branch "back") land in the original > state without loosing anything. Of course, this means, that the ignorant > checkout doesn't lead you into a clean state, but that's why I'd like to > use a switch instead of making it the default. :) One thing to consider. If there are conflicts, I don't think we should allow this "ignorant" mode. That would mess up work tree in a bad way. And because it would leave worktree in a dirty state, maybe --dirty-worktree is suggestive. -- Duy