From: Andrew Morton <akpm@linux-foundation.org>
To: david@lang.hm
Cc: git@vger.kernel.org
Subject: Re: Untracked working tree files
Date: Wed, 15 Oct 2008 12:26:21 -0700 [thread overview]
Message-ID: <20081015122621.a9674d75.akpm@linux-foundation.org> (raw)
In-Reply-To: <alpine.DEB.1.10.0810151211580.7808@asgard.lang.hm>
On Wed, 15 Oct 2008 12:14:34 -0700 (PDT)
david@lang.hm wrote:
> On Wed, 15 Oct 2008, david@lang.hm wrote:
>
> > On Wed, 15 Oct 2008, Andrew Morton wrote:
> >
> >> 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 do
git-reset --hard HEAD
git-reset --hard linux-next
git-checkout linux-next
and get
error: Untracked working tree file 'Next/SHA1s' would be overwritten by merge.
y
grr.
> I think you can also do git checkout -f head to force the checkout to
> overwrite all files
yup, that fixed it. whee, thanks.
> 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.
>
> is there a way to disable this?
>
> David Lang
next prev parent reply other threads:[~2008-10-15 19:27 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-15 18:56 Untracked working tree files Andrew Morton
2008-10-15 19:09 ` david
2008-10-15 19:14 ` david
2008-10-15 19:24 ` Andrew Morton
2008-10-15 19:26 ` Andrew Morton [this message]
2008-10-15 19:32 ` Nicolas Pitre
2008-10-15 19:34 ` Nicolas Pitre
2008-10-15 19:31 ` Linus Torvalds
2008-10-15 19:42 ` david
2008-10-15 19:56 ` Linus Torvalds
2008-10-15 20:17 ` david
2008-10-15 19:49 ` Andrew Morton
2008-10-15 20:08 ` Linus Torvalds
2008-10-15 20:23 ` Andrew Morton
2008-10-16 8:42 ` Paolo Ciarrocchi
2008-10-16 9:32 ` Andrew Morton
2008-10-15 20:23 ` Linus Torvalds
2008-10-15 20:30 ` Andrew Morton
2008-10-15 22:06 ` Junio C Hamano
2008-10-15 23:00 ` [PATCH] reset --hard/read-tree --reset -u: remove unmerged new paths Junio C Hamano
2008-10-15 23:16 ` Linus Torvalds
2008-10-16 6:27 ` Junio C Hamano
2008-10-16 7:20 ` Ingo Molnar
2008-10-16 14:49 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20081015122621.a9674d75.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=david@lang.hm \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).