Re: Untracked working tree files
From: Andrew Morton <akpm@linux-foundation.org>
Date: 2016-06-15 22:45:29
On Wed, 15 Oct 2008 12:14:34 -0700 (PDT) david@lang.hm wrote:
On Wed, 15 Oct 2008, david@lang.hm wrote:quoted
On Wed, 15 Oct 2008, Andrew Morton wrote:quoted
Date: Wed, 15 Oct 2008 11:56:54 -0700 From: Andrew Morton <akpm@linux-foundation.org> To: git@vger.kernel.org Subject: Untracked working tree files I often get this (running git 1.5.6.rc0 presently): y:/usr/src/git26> git-checkout linux-next error: Untracked working tree file 'arch/x86/kernel/apic.c' would be overwritten by merge. which screws things up. I fix it by removing the offending file, which gets irritating because git bails out after the first such instance, so I need to rerun git-checkout once per file (there are sometimes tens of them).what I do when I run into this is "git reset --hard HEAD" which makes all files in the working directory match HEAD, and then I can do the other checkout.
I was using this but it seems it wasn't in the right place in the script.
I think you can also do git checkout -f head to force the checkout to overwrite all files
OK, I'll try that.
the fact that git will happily leave modified things in the working directory appears to be very helpful for some developers, but it's also a big land mine for others.
These files weren't modified. By me, at least. git might have "modified" them, but it has all the info necessary to know that the file has no uncommitted changes.
is there a way to disable this? David Lang