Recursive remove

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Recursive remove

From: Peter Eriksen <hidden>
Date: 2016-06-15 22:42:16

Hello,

A way to recursively remove a directory /Some/Dir/ is a follows:

   git ls-files -z Some/Dir >rmfiles
   git update-index -z --force-remove --stdin <rmfiles
   git commit -a -m "Remove directory Some/Dir"
   rm -rf Some/Dir

What is a better way to do it?

Regards,

Peter

Re: Recursive remove

From: sean <hidden>
Date: 2016-06-15 22:42:16

On Fri, 13 Jan 2006 14:21:19 +0100
"Peter Eriksen" [off-list ref] wrote:
Hello,

A way to recursively remove a directory /Some/Dir/ is a follows:

   git ls-files -z Some/Dir >rmfiles
   git update-index -z --force-remove --stdin <rmfiles
   git commit -a -m "Remove directory Some/Dir"
   rm -rf Some/Dir

What is a better way to do it?
Hi Peter,

The following is a bit more concise but not better than your version:

rm -rf Some/Dir
git ls-files -z -d Some/Dir | git-update-index -z --remove --stdin
git commit -m "Remove directory Some/Dir"


Git could stand to have an "rm" command to make this easier.


Sean
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help