From 5fe8d9ad7df73b272cb196c4e24b5eecf7ebf679 Mon Sep 17 00:00:00 2001
From: tekkub <tekkub@gmail.com>
Date: Tue, 3 Nov 2009 03:01:42 -0700
Subject: Add note about cleaning up a local repo after filter-branch

---
 _posts/2009-09-09-removing-sensitive-data.textile | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

(limited to '_posts/2009-09-09-removing-sensitive-data.textile')

diff --git a/_posts/2009-09-09-removing-sensitive-data.textile b/_posts/2009-09-09-removing-sensitive-data.textile
index b0c558a..1d0b29b 100644
--- a/_posts/2009-09-09-removing-sensitive-data.textile
+++ b/_posts/2009-09-09-removing-sensitive-data.textile
@@ -52,6 +52,21 @@ Total 1058 (delta 590), reused 602 (delta 378)
 To git@github.com:defunkt/github-gem.git
  + 48dc599...051452f master -> master (forced update)</pre>
 
+h3. Cleanup and reclaiming space
+
+While @git filter-branch@ rewrites the history for you, the objects will remain in your local repo until they've been dereferenced and garbage collected.  If you are working in your main repo you might want to force these objects to be purged.
+
+<pre class="terminal">[tekkub@tekBook: ~/tmp/github-gem master] $ rm -rf .git/refs/original/
+[tekkub@tekBook: ~/tmp/github-gem master] $ git reflog expire --all
+[tekkub@tekBook: ~/tmp/github-gem master] $ git gc --aggressive --prune
+Counting objects: 1746, done.
+Delta compression using 2 threads.
+Compressing objects: 100% (1736/1736), done.
+Writing objects: 100% (1746/1746), done.
+Total 1746 (delta 993), reused 0 (delta 0)</pre>
+
+Note that pushing the branch to a new or empty GitHub repo and then making a fresh clone from GitHub will have the same effect.
+
 h2. Dealing with collaborators
 
 You may have collaborators that pulled your tainted branch and created their own branches off of it.  After they fetch your new branch, they will need to use @git rebase@ on their own branches to rebase them on top of the new one.  The collab should also ensure that their branch doesn't reintroduce the file, as this will override the @.gitignore@ file.  *Make sure your collab uses rebase and not merge,* otherwise he will just reintroduce the file and the entire tainted history... and likely encounter some merge conflicts.
-- 
cgit v1.3.1

