summaryrefslogtreecommitdiff
path: root/tech/clear up a large git folder.txt
diff options
context:
space:
mode:
Diffstat (limited to 'tech/clear up a large git folder.txt')
-rw-r--r--tech/clear up a large git folder.txt16
1 files changed, 16 insertions, 0 deletions
diff --git a/tech/clear up a large git folder.txt b/tech/clear up a large git folder.txt
new file mode 100644
index 0000000..1003a5f
--- /dev/null
+++ b/tech/clear up a large git folder.txt
@@ -0,0 +1,16 @@
+To clean up a large .git folder, first see what the giant files are by running this command:
+
+git verify-pack -v .git/objects/pack/pack-9987666e7a6a7ebb5abde337ba017dcf67534986.idx | sort -k 3 -n | tail -10
+
+That will get a list of blogs, you can then run:
+
+git rev-list --objects --all | grep <first few chars of blok>
+
+to see what the actual files are that are taking up so much space.
+
+Assuming you want to get rid of the large files and clear that space, you can do that like this (assume you want to get rid of a bunch of .mov files):
+
+git filter-branch --index-filter 'git rm --cached --ignore-unmatch *.mov' -- --all
+rm -Rf .git/refs/original
+rm -Rf .git/logs/
+git gc --aggressive --prune=now