git rm VERY slow for directories with many files.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I stupidly added a directory with many files ( ~450,000 ) to git, and want to delete them — later I plan to rebase/squash various commits to remove the files from the history altogether.

However, ‘git rm’ is VERY slow. For example, in a directory with 10,000 files (on a Mac), git v2.14.2

Git add . : 5.95 secs
Git commit : 1.29 secs
Git rm -r : 22 secs

50,000 files

Git add . : 25 secs
Git commit : 11 secs
Git rm : After 20 minutes, I killed it.

Looking at an optimized profile, all the time seems to be spent in “get_tree_entry” — I assume there is some huge object representing the directory which is being re-expanded for each file?

Is there any way I can speed up removing this directory?

Chris




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux