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

Re: How to stage a tree with all changes?

From
Jeff King <peff@peff.net>
Date
Jun 13, 2007, 18:40 UTC
Message-ID
<20070613184017.GF10941@coredump.intra.peff.net>
In-Reply-To
<861wgf964g.fsf@lola.quinscape.zz>
On Wed, Jun 13, 2007 at 06:22:23PM +0200, David Kastrup wrote:
> git-add .
> git-commit -a
> 
> seemingly overlooks deletions.
It shouldn't. Try this:

mkdir repo && cd repo git init echo foo >foo git add . git commit -m initial rm foo echo bar >bar git add . git commit -a

'bar' is scheduled for addition, and 'foo' is scheduled for deletion. Have you perhaps removed a file, but it's still in the working directory, and so picked up by your git-add? Can you give us a test case?

> What am I overlooking?  This should be simple, shouldn't it?
Yes, it should. :)
-Peff
Previous: Matthieu Moy
Message 3 of 3 in “How to stage a tree with all changes?”
  1. David KastrupJun 13, 2007
  2. Matthieu MoyJun 13, 2007
  3. Jeff KingJun 13, 2007

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.