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

[patch v2] documentation: Explain how to free up space after filter-branch

From
Thomas Jarosch <thomas.jarosch@intra2net.com>
Date
Dec 22, 2008, 09:06 UTC
Message-ID
<200812221006.45370.thomas.jarosch@intra2net.com>

Explain how to free up space after filter-branch. Thanks to Björn Steinbrink for pointing me in the right direction.

The v2 version of this patch uses "git repack -a -d" instead of "git repack -a -d --depth=250 --window=250" as this nocked down a box with 4GB of ram using a repository with medium sized binary files (50 - 100mb).

Signed-off-by: Thomas Jarosch <thomas.jarosch@intra2net.com>
diff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-
branch.txt
index fed6de6..1432380 100644
--- a/Documentation/git-filter-branch.txt
+++ b/Documentation/git-filter-branch.txt
@@ -319,6 +319,18 @@ git filter-branch --index-filter \
 	 mv $GIT_INDEX_FILE.new $GIT_INDEX_FILE' HEAD
 ---------------------------------------------------------------
 
+Free up the space in .git if the rewritten version is correct
+by deleting refs/original and pruning the reflog:
+
+----------------------------------------------------
+git for-each-ref --format='%(refname)' refs/original
+	| xargs -i git update-ref -d {}
+
+git reflog expire --expire=0 --all
+git repack -a -d
+git prune
+----------------------------------------------------
+
 
 Author
 ------
Message 1 of 1 in “documentation: Explain how to free up space after filter-branch”
  1. documentation: Explain how to free up space after filter-branchThomas Jarosch, Dec 22, 2008

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.