git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: How does Git know which files no longer needed during upgrade?

From
Miklos Vajna <vmiklos@frugalware.org>
Date
Mar 3, 2009, 23:30 UTC
Message-ID
<20090303233058.GE4371@genesis.frugalware.org>
In-Reply-To
<22318714.post@talk.nabble.com>
On Tue, Mar 03, 2009 at 01:51:14PM -0800, dealmaker <vinkhc@gmail.com> wrote:
>   I am going to upgrade software to a newer version in my main trunk, I
> decide to download the newer version and checkout the main trunk and  copy
> it over to my main trunk.

Do you mean the 'master' branch by 'main trunk'? Trunk is not in Git's terminology.

> If the older version has some files that are no
> longer in the newer version, how does git determine whether to keep those
> files or not?  Does it even notify me that those files are no longer needed?

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'

That will add/update/delete files as you would expect.
Previous: dealmakerNext: Jeff King
Message 2 of 5 in “How does Git know which files no longer needed during upgrade?”
  1. dealmakerMar 3, 2009
  2. Miklos VajnaMar 3, 2009
  3. Jeff KingMar 4, 2009
  4. Stefan NäweMar 4, 2009
  5. Jeff KingMar 4, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.