# Recursive remove

5 messages from 2006-01-13 to 2006-01-13. Participants: Peter Eriksen, sean, Junio C Hamano.
Thread: https://gitlist.dev/t/3069

## Peter Eriksen, 2006-01-13 13:21

Subject: Recursive remove
Message-ID: <20060113132119.GB23655@ebar091.ebar.dtu.dk>
URL: https://gitlist.dev/e/20060113132119.GB23655%40ebar091.ebar.dtu.dk

```
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

```

## sean, 2006-01-13 14:03

Subject: Re: Recursive remove
Message-ID: <BAYC1-PASMTP095A70114DD0A50FA6CAFAAE260@CEZ.ICE>
URL: https://gitlist.dev/e/BAYC1-PASMTP095A70114DD0A50FA6CAFAAE260%40CEZ.ICE
In-Reply-To: <20060113132119.GB23655@ebar091.ebar.dtu.dk>

```
On Fri, 13 Jan 2006 14:21:19 +0100
"Peter Eriksen" <s022018@student.dtu.dk> 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

```

## Junio C Hamano, 2006-01-13 17:37

Subject: Re: Recursive remove
Message-ID: <7virso9ggd.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7virso9ggd.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <20060113132119.GB23655@ebar091.ebar.dtu.dk>

```
"Peter Eriksen" <s022018@student.dtu.dk> writes:

> 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?

	$ rm -fr Some/Dir; git commit -a -m 'Remove'

perhaps?

```

## sean, 2006-01-13 17:56

Subject: Re: Recursive remove
Message-ID: <BAYC1-PASMTP08F3875A7636E18401E7B3AE260@CEZ.ICE>
URL: https://gitlist.dev/e/BAYC1-PASMTP08F3875A7636E18401E7B3AE260%40CEZ.ICE
In-Reply-To: <7virso9ggd.fsf@assigned-by-dhcp.cox.net>

```
On Fri, 13 Jan 2006 09:37:54 -0800
Junio C Hamano <junkio@cox.net> wrote:

> 
> 	$ rm -fr Some/Dir; git commit -a -m 'Remove'
> 
> perhaps?
> 

Sigh, its been a humbling morning all around; can't get easier than that.

Sean

```

## Junio C Hamano, 2006-01-13 19:51

Subject: Re: Recursive remove
Message-ID: <7vslrr6h4z.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vslrr6h4z.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <BAYC1-PASMTP08F3875A7636E18401E7B3AE260@CEZ.ICE>

```
sean <seanlkml@sympatico.ca> writes:

> On Fri, 13 Jan 2006 09:37:54 -0800
> Junio C Hamano <junkio@cox.net> wrote:
>> 
>> 	$ rm -fr Some/Dir; git commit -a -m 'Remove'
>> 
>> perhaps?
>
> Sigh, its been a humbling morning all around; can't get easier than that.

Perhaps this is because I did not do a good job in
Documentation/git-commit.txt.  Something like this?

-- >8 --
Documentation: git-commit -a

A bit more elaboration on what "update all paths" means.

Signed-off-by: Junio C Hamano <junkio@cox.net>

---
diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt
index e0ff74f..e35984d 100644
--- a/Documentation/git-commit.txt
+++ b/Documentation/git-commit.txt
@@ -25,7 +25,9 @@ information.
 OPTIONS
 -------
 -a|--all::
-	Update all paths in the index file.
+	Update all paths in the index file.  The command with this flag
+	notices files that have been modified and deleted, but new files
+	you have not told about git are not affected.
 
 -c or -C <commit>::
 	Take existing commit object, and reuse the log message

```
