From: Jeff King Date: Wed, 04 Mar 2009 09:49:51 GMT Subject: Re: How does Git know which files no longer needed during upgrade? Message-ID: <20090304094951.GA32433@coredump.intra.peff.net> In-Reply-To: <20090303233058.GE4371@genesis.frugalware.org> On Wed, Mar 04, 2009 at 12:30:58AM +0100, Miklos Vajna wrote: > First, I think storing upstream code (that you will never touch) in > version control is a horrible idea, but if you really do it, I would do > something like: > > cd /path/to/copy > rm -rf * > cp -a /path/to/new/version/* . > git add -A > git commit -m 'update foo to 2.0' Nit: "rm -rf *" will miss files starting with '.'. So it is probably simpler to say what you mean: delete all files managed by git: git ls-files -z | xargs -0 rm -f -Peff