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

Re: Deleting files

From
SShak <sshaikh@hotmail.com>
Date
Jun 12, 2008, 12:23 UTC
Message-ID
<g2r4ha$74i$1@ger.gmane.org>
In-Reply-To
<477B22F6-9F24-4CBE-98EE-58EF697E6320@ai.rug.nl>

"Pieter de Bie" <pdebie@ai.rug.nl> wrote in message news:477B22F6-9F24-4CBE-98EE-58EF697E6320@ai.rug.nl...

Show 9 quoted lines
>
> In short, the point is that you never commited the deletions! Your  whole 
> history
> until now will still show those deleted files. You can commit the 
> actually deletions
> now, as you should have done before (either by using "git rm <file>", 
> "git add -u",
> "git commit -a" or "git commit <file>".
>

Thanks for the quick workflow. To fill in a gap in my OP, I was using "git add ." to add new files before a "commit". Since I (perhaps incorrectly) took "commit -a" as a short cut for these two commands, I assumed that "git add ." would also commit deletions.

So sticking to my previous workflow (I need to do this since "commit -a" as I understand it doesn't commit new files, and I often forget that I've added :)), it seems I should do the following to keep the working directory in sync with the repository:

git add . git add -u git commit

Is that right? Should the two add commands be called in that order or doesn't it matter?

I ask because I'm still concerned with how git assumed I had renamed files after I had "git rm"d them. As far as I could tell they were not very alike. Perhaps adding the new files before removing the old ones would stop this behavior?

Shak 
Previous: Pieter de BieNext: Alex Riesen
Message 5 of 6 in “Deleting files”
  1. ShakJun 12, 2008
  2. ShakJun 12, 2008
  3. ShakJun 12, 2008
  4. Pieter de BieJun 12, 2008
  5. ShakJun 12, 2008
  6. Alex RiesenJun 12, 2008

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.