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

git rm bug?

From
EKEunsuk Kang <eskang@csail.mit.edu>
Date
Oct 30, 2013, 05:23 UTC
Message-ID
<155154AA-15E8-49E8-8261-6295AC6F6CF7@csail.mit.edu>
Hello,
My understanding was that running "git rm" on a file will delete all ancestors of the file that are empty directories from the file system. I've ran into a case that seems a little strange.
To reproduce (using version 1.8.4.1 on Mac OS X 10.7.5):

git init mkdir a mkdir b touch a/b/c.txt git add . git commit

Then, running the commands

$ rm a/b/c.txt $ git rm a/b/c.txt

deletes "c.txt" as well as both directories "a" and "b", as expected. But if I instead do

$ rm -r a/b $ git rm a/b/c.txt

then git deletes "c.txt" and "b", but leaves "a" intact in the file system. Is this a bug?

Thank you, Eunsuk

Next: Junio C Hamano
Message 1 of 2 in “git rm bug?”
  1. Eunsuk KangOct 30, 2013
  2. Junio C HamanoOct 30, 2013

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.