Re: Problems switching branches
- From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
- Date
- Nov 5, 2010, 08:41 UTC
- Message-ID
- <AANLkTinN7xE5eR7ncyr+mVhyNbz1r5Au=LFCJQgh8fMr@mail.gmail.com>
- In-Reply-To
- <4CD3A5D9.6070802@seznam.cz>
On Fri, Nov 5, 2010 at 1:36 PM, Maaartin-1 <grajcar1@seznam.cz> wrote:
Show 12 quoted lines
>> 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